Hi,
I’ve followed the steps provided in the Ionic documentation to enable push notifications on my app - everything seems to work fine (I can even send notifications to my iOS device from within the ionic dashboard). However what’s really bugging is it doesn’t seem the register promise is working.
I’m trying to store the device token on my server & assign that token to my users. Unfortunately everything inside my promise doesn’t run:
this.attachDeviceToken() simply sends the token via HTTP to my server.
this.push.register().then((t: PushToken) => {
this.device_token = t.token;
this.attachDeviceToken();
return this.push.saveToken(t);
});
I’ve also tried it this way:
this.push.register().then((t: PushToken) => {
return this.push.saveToken(t);
}).then((t: PushToken) => {
this.device_token = t.token;
this.attachDeviceToken();
});
The above code is currently running inside a custom authorisation provider.
When running in browser, I get this error:
core.es5.js:1084 ERROR Error: Uncaught (in promise): Error: Error subscribing for Push notifications.
Error: Error subscribing for Push notifications.
I’ve tried removing the platforms/plugin and re-adding to no avail. It would seem that even when testing on a physical device, attachDeviceToken() never gets to run. Has anyone had a similar issue or does anyone know of anything I could do to try and fix it?
Thanks