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

onMessage scenario error #11

Open
omeriko opened this issue Jun 18, 2013 · 0 comments
Open

onMessage scenario error #11

omeriko opened this issue Jun 18, 2013 · 0 comments

Comments

@omeriko
Copy link

omeriko commented Jun 18, 2013

I'm currently adding Notification logic to the app' using your plugin: GCM-Cordova.
I'm running a test project with your plugin to study it, so I installed it on eclipse, and i'm running it on an android device.
I manage to register the device for GCM messages + receive messages successfully.

When The device receives a message from Google Cloud, it calls the onMessage event handler (line 55, in this file: https://github.com/marknutter/GCM-Cordova/blob/master/src/com/cordova2/gcm/GCMIntentService.java) .
The event handler reaches line 77 to run this command: GCMPlugin.sendJavascript( json ); This commands supposed to call whatever legal Javascript i inject into it on the webView.

However at that particular scenario, the onMessage scenario, the static class' GCMPlugin members are not initialized at all, so the GCMPlugin.sendJavascript( json ) fails since all members of GCMPlugin are null.

As a result the message can't be delivered to the webView.

Summing it up: there is a need to handle an incoming message in a way that when the user taps a Notification - that tap not only turns on the application (or moves it back to the front if was paused), but also enables an ability to transfer some values from the Notification data to the UI using a javascript call.

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

No branches or pull requests

1 participant