简体   繁体   中英

how to Launch Cordova app when phone locked

I am working on an android app built on apache cordova. The app used to send your location via SMS, Email & in app notification to your predefined contacts. I want this sharing event to be triggered on double tapping on screen (when locked) or 3-4 times pressing the power button/ volume button.

Its for emergency situation, when user may not be able to unlock phone & open app to share any info.

I've searched a lot but could not find any relevant info. is there any available plugin to do that? I know very little of JAVA. Expecting any plugin that would allow me to launch the app(any activity) when phone is locked.

Any helpful information or suggestions are appreciated.

To accomplish this kind of task, you need to run a service in background, it is not possible to use any cordova webview, so you won't be able to run any javascript.

I don't think there is any plugin doing such a thing as it is very specialized.

I needed to create an app that needed to send notification to the user depending on his location. It ended up in writing a native plugin...

So the best advice I can give you is "It's never too late to learn Java" ;-)

maybe some other JS framework (maybe NativeScript ) allows such things but I never used it yet so it might be impossible too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM