You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
On android, when the app is in the background, an incoming notification will trigger GCMIntentService.onMessageReceived, buzz the app, open the app (when clicked in shade), but will not trigger my listener (via push.on('notification') in js) to the "notification" event.
With the app open your on('notification') event handler will always be called. You will not see anything in the notification shade unless you set options.android.forceShow to true.
App in Background
With the app open you will see a notification in the shade as long as your payload from GCM has a title or message component. Your on('notification') will not be called in this case. If the user clicks on the notification in the shade your app will start and your on('notification') event handler will be called.
If you do not provide a title/message in the payload from GCM then your on('notification') event handler will be called as it is assume this is a silent or data only notification.
App Close (ie not running)
You are pretty screwed at this point. Need to work on some code to restart the GCM service if the app is killed.
This is what is not true for me with 1.4.2 on android only, in the "App in Background" bucket:
If the user clicks on the notification in the shade your app will start and your on('notification') event handler will be called.
The app starts, but the event handler is not called.
Also, note that if the app is not in the background (no instance running), clicking on the notification in the shade will open the app and in fact call the notification event handler correctly. The issue I have is strictly when the app is in the background.
I'm using a Moto G on Android 4.4.4, Cordova Android 4.1.1, phonegap-plugin-push 1.4.2.
The text was updated successfully, but these errors were encountered:
@macdonst huge apologies here. I removed and re-added the plugin in my project, and the scenario works correctly. I have a small patch with a new hasPermission call that I put in to get notification settings, and that has somehow affected the scenario described above. Closing this. Sorry for the wasted cpu cycles!
On android, when the app is in the background, an incoming notification will trigger GCMIntentService.onMessageReceived, buzz the app, open the app (when clicked in shade), but will not trigger my listener (via push.on('notification') in js) to the "notification" event.
As @macdonst mentioned here,
This is what is not true for me with 1.4.2 on android only, in the "App in Background" bucket:
The app starts, but the event handler is not called.
Also, note that if the app is not in the background (no instance running), clicking on the notification in the shade will open the app and in fact call the notification event handler correctly. The issue I have is strictly when the app is in the background.
I'm using a Moto G on Android 4.4.4, Cordova Android 4.1.1, phonegap-plugin-push 1.4.2.
The text was updated successfully, but these errors were encountered: