react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

I am doing everything in the simplest form Yet I get this error, default firebaseapp is not initialized in this process make sure to call firebaseapp.initializeapp

Open wlaa41 opened this issue 5 years ago • 1 comments

Bug

I followed the steps one by one as even mentioned in https://www.youtube.com/watch?v=RgN1TEnULVQ I am still getting the same error

this is my build gradle


buildscript {
    ext {
          googlePlayServicesVersion = "+" // default: "+"
    firebaseMessagingVersion = "21.1.0"// default: "21.1.0"


        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
        supportLibVersion = "23.1.1" // default: 23.1.1

    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

this is my index.js

im``` port {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; import PushNotification from "react-native-push-notification";

PushNotification.configure({ onRegister: function (token) { console.log("TOKEN:", token); },

onNotification: function (notification) { console.log("NOTIFICATION:", notification); },

onAction: function (notification) { console.log("ACTION:", notification.action); console.log("NOTIFICATION:", notification); }, permissions: { alert: true, badge: true, sound: true, }, popInitialNotification: true, requestPermissions: true, });

AppRegistry.registerComponent(appName, () => App);

wlaa41 avatar Jul 19 '21 16:07 wlaa41

Hi, You probably missed some step or configuration with Firebase Please check the exemple project Regards

Dallas62 avatar Jul 19 '21 17:07 Dallas62