Ben Walker
Posts: 0
Joined: Mon Jan 19, 2015 2:13 pm

devices collection token "undefined" despite correct certification

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.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

devices collection token "undefined" despite correct certification

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

devices collection token "undefined" despite correct certification

Hello ,

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

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

Ben Walker
Posts: 0
Joined: Mon Jan 19, 2015 2:13 pm

devices collection token "undefined" despite correct certification

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.

Ben Walker
Posts: 0
Joined: Mon Jan 19, 2015 2:13 pm

devices collection token "undefined" despite correct certification

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

devices collection token "undefined" despite correct certification

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.

Return to “Issues”