Deki
Posts: 0
Joined: Tue Apr 15, 2014 4:53 pm

Token is undefined

I am trying to register a device for push notifications. I followed this tutorial http://devcenter.appery.io/tutorials/... and I have put the correct API Key and Sender ID. I also put it the following code on Device Ready screen and created corresponding localStorage variables.

pre
setTimeout(function() {
alert(localStorage.getItem('pushNotificationDeviceID'));
}, 1);

setTimeout(function() {
alert(localStorage.getItem('pushNotificationToken'));
}, 1);
/pre

However, the problem is that I keep getting "undefined" for pushNotificationToken. I can get the DeviceID just fine and it saves it to the database. Any help please?

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Token is undefined

Hello!

Could you show the a screenshots of your Push settings.
Please make sure that the fields "Sender ID" and "API Key" have no gaps.

Deki
Posts: 0
Joined: Tue Apr 15, 2014 4:53 pm

Token is undefined

There are no gaps in sender id and api key. i copied the straight from the google webpage.

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Token is undefined

Hi Deki,

Please share your app with us.
And share your DB with us.

Then write here your app name and dbname.

Thanks & regards.

Return to “Issues”