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 130 forks source link

Why are not all android actions supported? #115

Open sohelmk opened 4 years ago

sohelmk commented 4 years ago

Hi @darryncampbell, Thanks for the great work. This plugin worked but we needed to send an implicit intent to another app using action FLAG_ACTIVITY_NEW_TASK or ACTION_MAIN, but could not find these actions. Please let us know if there is any specific reason why these are not supported? Or if we fork your plugin and add these actions would they work?

Thanks a lot, SK

darryncampbell commented 4 years ago

FLAG_ACTIVITY_NEW_TASK is a flag, not an action... you can specify flags but I can't find a sample... but you should be able to define an int array of flags that will be processed by https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/blob/master/src/android/IntentShim.java#L521 e.g. for flag_activity_new_task put flags: [268435456] in your JSON object.

The action is just a string so you can specify android.intent.action.MAIN for ACTION_MAIN

sohelmk commented 4 years ago

Thanks a lot @darryncampbell we will try and update, but its good to hear that you think its possible.