简体   繁体   中英

Push notification using fcm in react native

I am working on react native push notification sample example . i am getting error to build the app .

Error is ...

: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

I am using android build.gradle with version

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

}

please help me how to resolve it..

in firebase console,you can:

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)

Make sure you have certificates setup by following https://firebase.google.com/docs/cloud-messaging/ios/certs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM