Hm, I'm trying to use sendJavascript in onNewIntent (which is getting called) to call a global function (or testing with alert()) and it's not getting called. I can't find any examples of sendJavascript being used in plugins for Android. Am I doing it wrong? How should I call Javascript from native?
On Wed, Aug 29, 2012 at 5:20 PM, Braden Shepherdson <[email protected]>wrote: > I don't know about the Message API, but it certainly has something to do > with the code a function below your link [1]: We capture onNewIntent and > call that on plugins. >_> > > So I'll use that, and it looks like it will work great. Thanks for the > link! > > Braden > > > On Wed, Aug 29, 2012 at 4:14 PM, Filip Maj <[email protected]> wrote: > >> Is this at all related to the high-level / general purpose "Message" api >> we have in plugins [1] [2]? Could that be used instead? >> >> [1] >> >> https://github.com/apache/incubator-cordova-android/blob/master/framework/s >> rc/org/apache/cordova/api/PluginManager.java#L318<https://github.com/apache/incubator-cordova-android/blob/master/framework/src/org/apache/cordova/api/PluginManager.java#L318> >> [2] >> >> https://github.com/apache/incubator-cordova-android/blob/master/framework/s >> rc/org/apache/cordova/api/Plugin.java#L114<https://github.com/apache/incubator-cordova-android/blob/master/framework/src/org/apache/cordova/api/Plugin.java#L114> >> >> On 8/29/12 12:10 PM, "Braden Shepherdson" <[email protected]> wrote: >> >> >I'm working on the status bar notification plugin for Android, hoping to >> >add support for onclick as in the W3C spec. >> > >> >There are basically three approaches to capturing the Intent when the >> >notification is clicked: >> >1. Create a new Activity that causes the onclick to be called and then >> >hands off to the main Cordova Activity. >> >2. Have the user of the plugin add onNewIntent() to the root of the app, >> >with code provided in the plugin's documentation. >> >3. Do something similar to the plugin polling when the top-level URL >> >changes. >> > >> >I've been investigating (1), but it requires adding an Activity to the >> app >> >manifest. (2) sucks in several ways. (3) appeals to me the most, but >> >requires that polling of plugins. It will only be active when something >> is >> >actually sending new Intents to the app, which currently doesn't happen >> at >> >all. It would also enable other apps to call into Cordova apps and have >> >plugins capture those events. (Share, etc.) >> > >> >Thoughts? I'm mostly glad I can actually support onclick. >> > >> >Braden >> >> >
