Hi @charles yu
My name is Harry, Support Engineer who specialize in UWP (Universal Windows Platform). Thank you for reaching out on Microsoft Q&A!
Some APIs like HumanPresenceSettings
often require your UWP app to be installed via the full app deployment pipeline. Just debugging from Visual Studio may not grant full permissions to them. So, you can try creating app package and install via Add-AppxPackage
to see if it works (make sure it is signed and installed with appropriate certificate).
You can also try using this line to verify what is actually available:
humanPresenceSettings = await HumanPresenceSettings.GetCurrentSettingsAsync();
var watcher = HumanPresenceSensor.GetDeviceSelector();
I hope this helps you get things back on track quickly! If my suggestions can solve your issue, feel free to interact with the system accordingly!
Thank you!