Ionic Push: Error: INVALID_SENDER - IONIC 2

Asked

Viewed 87 times

0

Fala galera!

I’m developing an app in which I have to use push notification. I followed the entire IONIC guid tutorial on this link, more than once, and I did not succeed.

I also followed this tutorial that performs notifications through Firebase itself, but also failed.

In the first example IONIC does not end the push, it is only forwarding. In the second example Firebase finalizes the notification, but do not receive in the app.

I discovered the error using the google Chrome checker (Chrome://Inspect/#Devices) and the following message appears.

inserir a descrição da imagem aqui

I double-checked my Sender_id and it’s correct. I have researched several times in several links of google and I did not get answer that solved my problem.

For what it’s worth, follow my package.json related to Ionic, Cordova and phonegap.

    "@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 don’t know what else to do. I look forward to any help. Thanks in advance!

1 answer

0

I discovered the problem when 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 I ended up putting the wrong value in sender_id. However, later I switched to the correct one, but it was not being replicated in all the files. Missing change in main.js, map.js, among others.

In the adb log I saw that the sender_id variable had the wrong value, I copied the value and searched for all references of this 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 again, so I should have changed the values.

Anyway, I hope to help more people if they come across this mistake.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.