Ionic Push: Error: INVALID_SENDER - IONIC 2

0

Talk about it!

I'm developing an app where I have to use push notification. I followed the entire IONIC GUID tutorial on this link , more than once, and I was not successful.

I also followed this tutorial that does the notifications through Firebase itself, but I was not successful either.

In the first example, IONIC does not end the push, it is just forwarding. In the second example Firebase ends the notification, but I do not get it in the app.

I discovered the error using google chrome inspec devices (chrome: // inspect / # devices) and the following message appears.

IhaverepeatedlycheckedmySender_idanditiscorrect.IhaveresearchedseveraltimesinseveralgooglelinksandIdidnotgetananswerthatsolvedmyproblem.

Ifitservesanything,itfollowsdeliveryfrommypackage.jsonregardingtheionic,cordandphonegap.

"@ionic-native/browser-tab": "4.0.1",
"@ionic-native/core": "4.0.1",
"@ionic-native/push": "4.0.1",
"@ionic-native/splash-screen": "4.0.1",
"@ionic-native/status-bar": "4.0.1",
"@ionic/cloud-angular": "^0.12.0",
"@ionic/storage": "2.0.1",
"cordova-android": "^6.2.3",
"cordova-browser": "^4.1.0",
"cordova-plugin-browsertab": "^0.2.0",
"cordova-plugin-compat": "^1.0.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.1",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.0.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"phonegap-plugin-push": "^1.10.5",

Anyway, I do not know what else to do. I look forward to any help. Thank you in advance!

    
asked by anonymous 20.07.2017 / 04:16

1 answer

0

I discovered the problem by running the adb logcat command.

When I first set up my app, it was also the first time I was setting up a push notification and ended up putting the wrong value in sender_id. However, afterwards I changed to the correct one, but it was not being replicated in all the files. It was missing changing in main.js, map.js, among others.

In the adb log I saw that the sender_id variable was the wrong value, I copied the value and searched for all references of that value (ctrl + shift + f in VS Code) and changed all, thus solving the problem

The strange thing is that I removed the platform and added it again, so I had to change the values.

Finally, I hope to help more people if you encounter this error.

    
21.07.2017 / 14:43