Ionic push notification register problem (don't get token) FIXED!


#1

Hello!

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?

Thanks.
Ana.


Ionic Push not working on Android
#2

I am getting the exact same problem. When I run ionic run android -lc I get the following Error:

“6 587417 error Ionic Push:, GCM project number not found (http://docs.ionic.io/docs/push-android-setup)”

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.

I’m in desperate need of a solution.


#3

Reinstall android platform works for me!

ionic platform rm android
ionic platform add android

Maybe it works for you too :wink:


#4

@anuskinina unfortunately tried that and it didn’t work for me. I have given up on Ionic push for now.


#5

only work in ionic config set dev_push false

sigh!