0

I have a react-native application with its backend in NodeJS. I started implementing notifications using expo-notifications and it is working fine in production with iOS but not with Android.

I have followed this documentation to implement everything. I know that for android I have to setup FCM which is what I did using this.

What I did :

  1. Created my Firebase App
  2. Added Firebase to my Android App
  3. My Android package name is the same as the value of android.package in my app.json
  4. Downloaded google-services.json and placed it in my Expo app's root directory
  5. Uploaded the server credentials using expo push:android:upload --api-key . This has been well configured because when I do expo push:android:show I see the correct token

However, in production I get this error:

Exception occurred while executing exported method getDevicePushTokenAsync on module ExpoPushTokenManager. Please set your Project ID. A valid firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Goolge.

Did I forget any of the steps ? What is wrong with my project ID? Do I need to completely rebuild my code and send it on Google Play Store or can I do an instant update using expo publish ?

Here is my app.json android in case:

 "android": {
      "versionCode": 13,
      "userInterfaceStyle": "light",
      "package": "com.xxx.xx",
      "googleServicesFile": "./google-services.json",
      "useNextNotificationsApi": true,
      "permissions": [
        "CAMERA",
        "CAMERA_ROLL",
        "MEDIA_LIBRARY",
        "WRITE_EXTERNAL_STORAGE",
        "READ_EXTERNAL_STORAGE",
        "NOTIFICATIONS"
      ]
    },

Any help would be appreciated :)

PS : I had a look at this question but still getting same problem.

colla
  • 717
  • 1
  • 10
  • 22
  • What push notification service are you using? Looks like you are using expo push notifications service, I think you have to use: `getExpoPushTokenAsync`. The other returns a FCM token and not a expo one – Wilber Hinojosa Nov 01 '22 at 00:16

0 Answers0