I need to detect Mobile Unlock event in my application ( That will be either running all the time or will resume at unlock) . Can you suggest what should i do? Thanks.
Asked
Active
Viewed 315 times
0
-
Please give more details about the situation. – Frank Lexer Feb 17 '20 at 12:40
-
Is one of these appropriate for you? https://docs.nativescript.org/core-concepts/application-lifecycle#use-application-events – Norbert Huurnink Feb 17 '20 at 12:58
-
1There is no out-of-the-box event that you can directly hook to. However, you can use the native solutions in NativeScripty (of course, you will need to convert the code to JavaScript/TypeScrit using the NativeScript marshaling) .Example of how native Android devs are handling the case: https://stackoverflow.com/questions/3446202/android-detect-phone-unlock-event-not-screen-on – Nick Iliev Feb 17 '20 at 13:01
-
In Android you could use a BroadcastReceiver to detect unlock, just like @NickIliev pointed. I don't think iOS allows anything as such, but with iOS 13.x and later, you may use BGAppRefreshTask for long running background tasks. – Manoj Feb 17 '20 at 16:47
-
Thanks a lot. This will help .. i will check and circle back . – SmartElf Feb 18 '20 at 13:20