While trying to get the lockscreenaccessstatus by calling BackgroundExecutionManager.RequestAccessAsync()
on the very first launch of my WinRT app, I am getting this exception:
(Exception from HRESULT: 0x80070490)
Weirdly, this issue is no more happening on the second (and subsequent) launch of the app.
I read that as a workaround we can introduce a Task.Delay(1000)
just before calling the BackgroundExecutionManager.RequestAccessAsync()
. But, it does not seem to be working for me. Any ideas?
So, I finally was able to figure out the workaround. I moved the code to prompt the user BackgroundExecutionManager.RequestAccessAsync()
to a later stage, i.e. when I have loaded my first VM. It all works fine now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With