I’m trying to run push notifications for a long time. I’ve followed the steps from ionic documentation (https://devdactic.com/ionic-push-notifications-guide/) and also researched on Google, on this forum… but my app doesn’t work.
I get success on dev-push notification. But when I run the app in a real Android device it doesn’t work. I didn’t get any error but the register is not right… I don’t get any token for my device.
I installed the push plugin notification with my sender ID, set the gcm_key (28017XXXXX) in my project and dev_push to false. Also I set the API key Server (AIzaSyAISyWLXXXXXXXXXXXXXXXXXXXXX) in the security profile and run ionic build android.
I don’t know what it’s going wrong… I’m kind of desperate…
What could be happening?
When I set the ionic config set gcm_key I start getting the following error:
8 399814 error Ionic Push:, (debug) unexpected error occured.
9 399839 error Ionic Push:, [object Object]
However on iOS everything works on my device. And on my android if I set ionic config set dev_push true, then the push notifications also work on my device.
console.log(“Device token:”,token.token); On Android doesn’t generate anything but it works fine on iOS.