Where do I put SENDER_ID for phonegap-plugin-push 2.0.0?

2.1k Views Asked by At

phonegap-plugin-push 2.0.0 "PushPlugin"

I updated phonegap-plugin-push to 2.0.0. And on the documentation it says

"As of version 2.0.0 the SENDER_ID parameter has been removed at install time. Instead you put your google-services.json (Android) and/or GoogleService-Info.plist in the root folder of your project and then add the following lines into your config.xml."

So in my config.xml, I have:

enter image description here

enter image description here

And I also created those files to my project folder:

enter image description here

But then I don't know what to write in those two files! I want to write SENDER_ID="1234567" in those files, but in what format?

The doc doesn't have an example for putting in SENDER_ID on those files.

Help!

2

There are 2 best solutions below

1
On BEST ANSWER

You don't have to write those file on your own!!

In my case, I use FCM to send push notifications and I downloaded them from the FCM portal. Are you using FCM or something else? Anyway, those files have to be downloaded.

Which push service do you use? FCM, Azure,..?

Further, with the push plugin 2.0.0, make sure you use the phonegap versione "cli-7.0.1".

0
On

For the version 2.x, you don't need to add the SENDER_ID while installing the plugin. The plugin parses its own from the Google-service.json and google-service.info.plist file

simply install the plugin using the command

ionic Cordova plugin add phonegap-plugin-push

and after that

npm-install