Notification Not Working on Corona 2017.3068

Hi guys,

Anyone notice that the Android device is not getting any push-notification ID on the new corona builds ?

Went thru the guides again to ensure there are no changes (https://docs.coronalabs.com/guide/events/appNotification/index.html)

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 )

What happens if you use 2992? or maybe 3037? something in that range?

Rob

Is it just my code, or something else ? No one else seems to be mentioning about this issue.

Went thru the changes doc, and selected a few that may cause it.

Results :

2992 : Ok. Able to get notification id on Android

2993 : Ok. Able to get notification id on Android

3002 : Ok. Able to get notification id on Android

3005 : Not working. Unable to get notification id on Android.

3037 : Not working. Unable to get notification id on Android.

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.

Have you filed a bug report on this yet?

Thanks

Rob

Ok, just filed a bug report. Still waiting for the id in my email. Will update this post when I get it.

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.

Thanks

Rob

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.

CaseID 8505048

Dear Rob,

Any updates on this ? Or we should be using the firebase instead. I can’t update my Android apps at the moment.

Thanks

Have you tried adding this to your plugins?

["shared.google.play.services.gcm"] = { publisherId = "com.coronalabs", supportedPlatforms= { android=true } }, 

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.

ingemar,

we’re having the same issue but adding that to plugins isn’t making a difference for us.

@rich.stupek

Can you post your build.settings?

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).

That’s a bit weird as the old plugin uses the gcm libraries only.
Do you by any chance have access to an old token compared to a new token?

we still need the old GCM running first , as it takes time to migrate. Is the old notification-plugin been removed/disabled ?

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.

Rob

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.

cvvD1GcgbTI:APA91bHa8cnEXmcSNUgw92amUechL1KUZmVnZQ8dec1_uDn1H2RgmRGcQvSSefxOr40xJXe6DOaikfuIOJzVIOtE3p6f-EPZm57Td1xm_3Y4DO5qUTdz4e_P6AyRwG9Pi6jlMWTiF_iU

old (GCM, length 162 chars) :

AAA91bG5GKIAMOMOcLRV5Lq4FWvvFycIQ6kDLhFHs_bUjEsbOUW2J4VqaPsOfNlIt7Tp0lqalwaneY2l-_xnUkOSZzBr3OqWHwD-zy3YGdfKYoeJTh9yz5HJQtbBK1TZ4z_RZfNPQeAPO7fyqm5ctDsRTadkQ8tFxA

@yosu

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.