Cannot get expo push notification token

Please provide the following:

  1. SDK Version: expo 45.0.6
  2. Platforms(Android/iOS/web/all): android 11/10, IOS 12 pro(simulator/not tested on), web: don’t use
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

expo-notificaitons

I am using the expo-notificaiton for the push notification feature.

try {

        token = (await Notifications.getExpoPushTokenAsync()).data;

        console.log("GET TOKEN", token)

} catch (error) {

        console.log("GET TOKEN_ ERROR", error)
 
}

the console is looks like this:
[Error: Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE]

SERVICE_NOT_AVAILABLE
I am not sure what does this mean.
The most weird thing is I can get android 10 phone as well, but on android 11, I cannot get the token, all of the permissions are granted on android 11.(I confirmed about this via console statements)

Any solution here?

Is that working on killed app or only on foreground and background app?!

This is not related with such status (foreground/background).
I cannot even get token at all in android device which is version 11.

I followed steps mentioned above link of doc. sometimes works and sometimes not work. and it works in android 10 and it does not get token on android 11.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.