Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one possible solution for issue #7 #16

Merged
merged 3 commits into from
May 9, 2017
Merged

one possible solution for issue #7 #16

merged 3 commits into from
May 9, 2017

Conversation

lentschi
Copy link
Contributor

@lentschi lentschi commented Apr 16, 2017

This just puts an extra on the intent (cordova_autostart = true), if the app has been started after boot.

Then you can use some plugin to access the intent and determine how the app has been launched.

To do so, first install a plugin to read the intent - e.g.:
cordova plugin add https://github.com/napolitano/cordova-plugin-intent --save

Then use it to access the intent - e.g.:

// It seems, this code can even be run before cordova's deviceready event is triggered:
window.plugins.intent.getCordovaIntent(function(intent) {
   if (intent.extras
        && intent.extras.cordova_autostart) {
     console.log("App has been launched automatically after boot.");
   }
   else {
     console.log("App has been launched manually.");
   }
});

@paredesivan
Copy link

thank you i will try it

@ToniKorin ToniKorin merged commit 5e65b53 into ToniKorin:master May 9, 2017
@paredesivan
Copy link

@lentschi
I tried it, and it's work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants