Page 1 of 1

Token is undefined

Posted: Wed Aug 06, 2014 11:05 pm
by Deki

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?


Token is undefined

Posted: Thu Aug 07, 2014 12:00 am
by obullei

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.


Token is undefined

Posted: Thu Aug 07, 2014 1:48 pm
by Deki

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

Image


Token is undefined

Posted: Thu Aug 07, 2014 10:57 pm
by Yurii Orishchuk

Hi Deki,

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

Then write here your app name and dbname.

Thanks & regards.