使用fcm推送通知in react native

时间:2018-05-15 07:07:08

标签: reactjs react-native

我正在研究反应原生推送通知示例示例。 我收到错误来构建应用程序。

错误是......

:app:processDebugGoogleServices
Parsing json file: E:\REACT-NATIVE\fcmreactnative\android\app\google-services.json
:app:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Failed to delete: E:\REACT-NATIVE\fcmreactnative\android\app\build\generated\res\google-services\debug

我正在使用带有版本

的android build.gradle
dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.2.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

and android/app/build.gradle

dependencies {
     compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:24.2.1"
    compile "com.facebook.react:react-native:+"  // From node_modules

}

请帮我解决一下..

1 个答案:

答案 0 :(得分:0)

firebase控制台中,您可以:

for Android: download google-services.json file and place it in android/app directory
for iOS: download GoogleService-Info.plist file and place it in /ios/your-project-name directory (next to your Info.plist)

确保按照https://firebase.google.com/docs/cloud-messaging/ios/certs

设置证书
相关问题