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.
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
I get exactly this problem too. Works in expo client, works iOS stand-alone but does not work on Android stand-alone.
an emergency problem for me and that needs to be resolved immediately.
I’m waiting for help from expo moderators.
With android you must create app in firebase and write all app info,then connect with your project,
you can read this in documentation:::
If you have not already created a Firebase project for your app, do so now by clicking on Add project in the Firebase Console.
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.
google-services.json file and place it in your Expo app’s root directory.
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
Finally, make a new build of your app by running
expo build:android .
Still having the same issue, any update for this issue??
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
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 :
- Follow this steps (push integration)
- Follow this steps (firebase integration)
- expo build:android
- expo push:android:upload --api-key
For Server-Key firebase console > Gear icon > Cloud Messaging