我在哪里放置 phonegap-plugin-push 2.0.0 的 SENDER_ID?

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

phonegap-plugin-push 2.0.0 "PushPlugin"

我将 phonegap-plugin-push 更新到了 2.0.0。 在文档上它说

"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."

所以在我的 config.xml 中,我有:

我还将这些文件创建到我的项目文件夹中:

但是我不知道在那两个文件里写什么! 我想在那些文件中写 SENDER_ID="1234567",但格式是什么?

该文档没有在这些文件上放入 SENDER_ID 的示例。

求助!

您不必自己编写这些文件!!

就我而言,我使用 FCM 发送推送通知,并从 FCM 门户下载它们。您使用的是 FCM 还是其他?无论如何,这些文件必须下载。

您使用哪种推送服务? FCM, Azure,..?

此外,使用推送插件 2.0.0,确保使用 phonegap 版本 "cli-7.0.1"。

对于版本2.x,安装插件时不需要添加SENDER_ID。该插件从 Google-service.json 和 google-service.info.plist 文件

中解析自己的

只需使用命令安装插件

ionic Cordova plugin add phonegap-plugin-push

之后

npm-install