darryncampbell / darryncampbell-cordova-plugin-intent

General purpose intent shim layer for cordova appliations on Android. Handles various techniques for sending and receiving intents.
MIT License
86 stars 136 forks source link

Is it posibble to receive intent data when the app is closed? #48

Closed AlexRojasEmpowerlabs closed 6 years ago

AlexRojasEmpowerlabs commented 6 years ago

On Android 6.0.1. I have the plugin working perfectly when the cordova app is open, but when I close the cordova app and go to other app (like Pinterest, Chrome, Facebook) and try to send data to my app again, the onIntent event is not triggered.

Any idea about how to solve this?

Thanks for this amazing plugin.

darryncampbell commented 6 years ago

Hi thanks, onIntent maps to Android's onNewIntent https://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent) which requires some combination of singleTop or the single top flag. You could use getIntent exposed by this plugin to return the intent that started the activity, this maps to https://developer.android.com/reference/android/app/Activity.html#getIntent()

AlexRojasEmpowerlabs commented 6 years ago

Good idea. It worked!. Thank you again.