Page 1 of 1

devices collection token "undefined" despite correct certification

Posted: Wed Jul 19, 2017 11:03 pm
by Ben Walker

When the app is installed, the device is shown in the devices collection. However, the token string is "undefined".

I have tried multiple fixes - stopping and starting app, reinstalling, recompiling. I have switched all certification to development, and tried using all with production. I still get the same error.

As a result, when I try to send a push, the error "invalid token". I have previously had push notifications working with this app, I don't understand why it's now stopped.


devices collection token "undefined" despite correct certification

Posted: Thu Jul 20, 2017 12:42 am
by Bruce Stuart

Hi Ben,

Just thinking out loud - Has your push notification certificate expired at the store level? do you have the correct notification certificate linked into the application if it has expired one or more times??

You've likely covered these angles.... it's just the first thing that came to mind....

Best,

Bruce


devices collection token "undefined" despite correct certification

Posted: Thu Jul 20, 2017 2:00 pm
by Serhii Kulibaba

Hello ,

Bruce is right, please check the expiration date of your certificates.

Could you also clarify, how do you send Push Notifications there?


devices collection token "undefined" despite correct certification

Posted: Thu Jul 20, 2017 4:19 pm
by Ben Walker

Certificates are all brand new. Once the problem started, I refreshed them all.

I have tried sending push notifications manually from the push module. It correctly shows one device registered in "number of devices" and I get the message "push sent". However, the "scheduled and history" tab shows an invalid token error, and then the device is removed from the devices collection in the linked database.

I also send push notifications programmatically from the app. These show up correctly in the "scheduled and history" tab, but then the same problem occurs.


devices collection token "undefined" despite correct certification

Posted: Thu Jul 20, 2017 4:42 pm
by Ben Walker

Additionally, I added push initialize, push registration success and push registration failure event listeners.

The initialize, and registration success events are both firing correctly. However, "token" per the devices collection is still undefined.


devices collection token "undefined" despite correct certification

Posted: Fri Jul 21, 2017 12:31 pm
by Illya Stepanov

Hi Ben -

We have checked your app "parkingClub" and you're using the old Libraries version 2.3 which has an outdated Push API and that is why the registered device does not get the token value upon the registration.

Please update your project Libraries version to 4.0 and use Push plugin version 1.8.4 and follow the configuration steps from here: https://docs.appery.io/docs/pushnotif...

This should help solving the issues with Push notifications in your app.