Push notifications on production

hi all!
I am starting using this platform and working with push notifications.
When i go to production, setting “ionic config set dev_push false” if i try the method:
push.register(function(token) {
saveDeviceID(token.token );
console.log(“Device token:”,token.token);
});

i have this error Uncaught ReferenceError: PushNotification is not defined.
So, let’s asume that is ok, because i am not on development anymore.

But after that, i create the APK.
(it’s like 5 minutes, ok!!)

And when i open the app on my phone (first in android), the deviceID is not saved.
So i don’t know what to do.
There is no information on the site about this kind of problem on production.

Do you have any idea, what’s next step?

Thanks!

Hi @arilishu,

Did you set up APNS or GCM?

Also, are you aware that you can use Safari Developer mode to inspect and console your native build when it’s connected to your computer via USB? This technique will let you log various values and objects and maybe debug your issue (if you’ve already set up APNS/GCM).

Thanks @stewartmccoy for your reply.
The GCM was ready, but i didn’t take care that i was creating the keystore every time i published the app! I didn’t know that :(.

Now it’s solved, and working!
Thanks!

1 Like

Can explain how solved this problem?