小编Jor*_*aso的帖子

使用cordova-plugin-fcm通过PhoneGap Build构建Firebase推送通知

我需要在我正在开发的PhoneGap Build应用程序中实现推送通知.

我没有找到关于使用新的Google服务Firebase云消息传递(FCM)的文档,但由于它应该是我们现在必须使用的,因此我搜索了一个可以让我的生活更轻松的API.

我找到了:https://www.npmjs.com/package/cordova-plugin-firebase

所以我添加到我的config.xml:

<plugin name="cordova-plugin-fcm" source="npm" />
Run Code Online (Sandbox Code Playgroud)

并将我从https://console.firebase.google.com/创建的google-services.json放在我压缩的文件夹的根目录中,以便上传到Phonegap Build.

但是我收到以下错误:

Execution failed for task ':processReleaseGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
  Searched Location: 
  /project/src/release/google-services.json
  /project/google-services.json
Run Code Online (Sandbox Code Playgroud)

我在根目录中创建了"project"文件夹并将文件放在那里,但这两者都不起作用.

目前我的app文件夹如下所示:

\css
\img
\js
\res (icons and splashscreens)
index.html
config.xml
google-services.json
Run Code Online (Sandbox Code Playgroud)

如果有人知道我要放置该文件的位置,或者使用其他API有任何其他方式来实现它,我会非常感激.我从未使用过Phonegap CLI,我一直在使用Phonegap Build.

push-notification firebase phonegap-build cordova-plugins firebase-cloud-messaging

9
推荐指数
2
解决办法
2万
查看次数