Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Issue on Android : FirebaseMessaging.getInstance().getToken() and FirebaseMessaging.getInstance().deleteToken(); #2154

Open
@aditya-keri-betterhalf

Description

@aditya-keri-betterhalf

Question

My project was previously using the react-native-push-notification version 3.5.2. Today I upgraded the same to the latest version - 8.1.0. I also upgraded the @react-native-community/push-notification-ios to 1.10.1.

When I try to build the android app, I get the error :
> Task :react-native-push-notification:compileDebugJavaWithJavac FAILED

The two main errors after this error are:

/Users/apple/Desktop/Push-Notifications/betterhalf-mobile-rn/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:140: error: cannot find symbol
      FirebaseMessaging.getInstance().getToken()
                                     ^
  symbol:   method getToken()
  location: class FirebaseMessaging
/Users/apple/Desktop/Push-Notifications/betterhalf-mobile-rn/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:283: error: cannot find symbol
      FirebaseMessaging.getInstance().deleteToken();
                                     ^
  symbol:   method deleteToken()
  location: class FirebaseMessaging

My firebase packages are as follows:

    "@react-native-firebase/app": "^10.0.0",
    "@react-native-firebase/crashlytics": "^10.0.0",
    "@react-native-firebase/in-app-messaging": "^10.0.0",
    "@react-native-firebase/messaging": "^10.0.0",
    "@react-native-firebase/perf": "^10.0.0",

Entire error log in gist : https://gist.github.com/aditya-keri-betterhalf/8b026335e442e9774c6960b4879c8f06

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions