getExpoPushTokenAsync Fetching the token failed

Error: Fetching the token failed: Given string is empty or null

The app is asking for permission and after giving permission it is being ‘granted’ successfully. Next I am using let token = await Notifications.getExpoPushTokenAsync() to get the token but it returns anything.

working on expo but standalone app not working.

1 Like

I have same problem. help us

I am using same code in expo docs. token creating in expo but not working standalone app.
Is it the same in your case?

yes, the standalone app gives me that error, I don’t really know how resolve it

1 Like

I get exactly this problem too. Works in expo client, works iOS stand-alone but does not work on Android stand-alone.

1 Like

an emergency problem for me and that needs to be resolved immediately.
I’m waiting for help from expo moderators.

1 Like

With android you must create app in firebase and write all app info,then connect with your project,
you can read this in documentation:::

Client Setup

  1. If you have not already created a Firebase project for your app, do so now by clicking on Add project in the Firebase Console.

  2. In your new project console, click Add Firebase to your Android app and follow the setup steps. Make sure that the Android package name you enter is the same as the value of android.package in your app.json.

  3. Download the google-services.json file and place it in your Expo app’s root directory.

  4. In your app.json, add an android.googleServicesFile field with the relative path to the google-services.json file you just downloaded. If you placed it in the root directory, this will probably look like

  "android": {
    "googleServicesFile": "./google-services.json",

Finally, make a new build of your app by running expo build:android .

1 Like

Still having the same issue, any update for this issue??

Yes I have same problem.

I have done all steps that you reminded, but, I also got the same error . “Failed: token SERVICE_NOT_AVILIABLE”

Guys, if your app already in google play store. You need upload apk in store after follow this steps or @seda1094

i guess expo build:android does not always reach Google side. But load or update to apk from google play developer console always working for me.

by the way don’t skip any steps and expo publish not working for this problem.

If your app already in google play store :

  1. Follow this steps (push integration)
  2. Follow this steps (firebase integration)
  3. expo build:android
  4. expo push:android:upload --api-key

For Server-Key firebase console > Gear icon > Cloud Messaging