I even tested on the default code, and it does not get anything.
It works on builds 2016.2961 & 2016.2883
does not work on builds 2017.3068 & 2017.3064
I have not tested on Apple yet, but will do so soon.
Update : Tested 2017.3068 on Apple, and notification id is received. So, it works on Apple but not on Android.
local function notificationListener( event ) if ( event.type == "remote" ) then --handle the push notification print( '--- notification remote' ) elseif ( event.type == "remoteRegistration" ) then --code to register your device with the service print( '--- notification remoteRegistration' ) end end Runtime:addEventListener( "notification", notificationListener )
3005 is the build where we changed plugin dependencies. But no one else is complaining about the plugin. We are working on bringing Firebase Cloud Messaging to people, but my understanding it it would be a new notifications plugin and the existing one would be fine. Let me get the team to look into this further.
If you’ve not gotten a response yet, please email the bug report to support AT coronalabs.com and attach your project to the email. Make sure to provide all the same information in the mail that you did in the form.
Email has been sent. Weird that I have not received any bug/case id for it after filling up the form. It is usually sent within a few hours of submitting a bug.
This was a necessary change in the new public build as Local Notifications should be able to be used without requiring GCM related components. Adding the above plugin will activate GCM.
I tested with your sample app and the “remoteRegistration” event is received after adding the GCM plugin.
It looks like the issue is that notification ids are coming in as fcm ids instead of the old gcm ids with new builds (not including the new notification plugin yet).
The legacy plugin will stay indefinitely as long as Google supports GCM for existing apps. It’s still plugin.notifications so you shouldn’t need any changes if you’re already setup for it.
After much banging of the head against the wall on this, here’s what I’ve learned. The notification event providing the devices push id only seems to occur when a fresh install of the app is done. Maybe its always worked this way but I thought previously we got the devices push id through the notification event each time the app started (and that’s how it seems to work on IOS). This is with GCM push ids. Did something change in the implementation of the legacy plugin?
There has been no change to the legacy plugin. It’s the same binary as before.
What you describe is the way the Android plugin has always worked.
On Android a “remoteRegistration” event only occurs on these occasions:
a) Fresh install
b) The GCM token has changed
iOS behaves differently as it needs a call to registerForPushNotifications(). This function will post a “remoteRegistration” event with a new token on fresh install, or the old token on app start.
In the legacy GCM (when it worked), I always get a GCM id when the app starts. From what I believe, at the background it will just call to get the GCM-id, and return the GCM-id regardless of whether it is the same or different. From time to time, the GCM-ids for a particular device/app do change.
Edit :
Did some test using the new notification-plugin-v2.
Token ids are only received when app starts the first time. Subsequent launches of the app will NOT trigger the event ‘remoteRegistration’, so make sure the event.token is grabbed when it is there the first time.
Sample of new FCM notification id (FCM, length 152 chars). Note the special characters.
The strange thing is that the plugin binary being used for the legacy notifications plugin is from 2015-01-22.
The only thing I can think of that has changed is that we introduced the Android Dependency system in December last year which bumped the Google Play Services version up to 9.6.1.