文件google-services.json丢失.没有Ionic 3,Google Services插件将无法运行 [英] File google-services.json is missing. The Google Services Plugin cannot function without it ionic 3
问题描述
我正在使用FCM进行推送通知,我总是收到此错误消息
I am using FCM for push notification I always get this error message
缺少文件google-services.json.Google服务插件 没有离子3就无法运行
"File google-services.json is missing. The Google Services Plugin cannot function without it ionic 3"
在电话上,我已将google-services.json放在每个文件夹上,但没有任何作用
on phone I have placed my google-services.json on every folder and nothings working
推荐答案
下载google-services.json所需的全部拳头:
Fist of all you need to download google-services.json:
- 登录Firebase并打开您的项目.
- 单击设置"图标,然后选择项目设置".
- 在您的应用"卡中,从列表中选择您需要配置文件的应用的程序包名称.
- 点击google-services.json.
( =" https://support.google.com/firebase/answer/7015592 )
好,现在您必须安装cordova-support-google-services
Ok now you have to install cordova-support-google-services:
cordova plugin add cordova-support-google-services --save
然后,您必须将google-services.json放入项目的根目录(在同一级别的www文件夹外部),然后resource-file标记会将其复制到platform/android/app/
Then, you have to put the google-services.json in the root of your project (outside www folder, at the same level), and then the resource-file tag will copy it to platforms/android/app/
接下来,放入config.xml
Next, put in the config.xml
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
...
</platform>
注意:如果您使用版本7以下的cordova-android,请改为指定:
Note: if you use cordova-android below version 7 specify instead:
target ="google-services.json"
target="google-services.json"
现在再次尝试构建!
这篇关于文件google-services.json丢失.没有Ionic 3,Google Services插件将无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!