getExpoPushTokenAsync not responding on Android testing device

Viewed 215

i know there have been a few similar post regarding “standalone” devices out there, but this is about a (still) testing device in connection with the Expo XDE.

In short:

I am trying to get the Push Notification token using getExpoPushTokenAsync this is working perfectly for iphones, but not for android phones

Code: token = await Notifications.getExpoPushTokenAsync(); –> return token for iphone, but nothing happens on Android (not even any following console.log)

just before: const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); –> returns “granted”

I am using: “expo”: “^36.0.0”,

// if no existing permission ask user for permission
   console.log("status: -" + status + '-');
    if (status !== 'granted') {
      // Android remote notification permissions are granted during the app
      // install, so this will only ask on iOS
      const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
      finalStatus = status;
    }

    // If no permission, exit ...
    if (finalStatus !== 'granted') {
      return;
    }

    // Get the token that uniquely identifies this device
    console.log("BEFORE TOKEN....");
    let token = await Notifications.getExpoPushTokenAsync();
    console.log("TOKEN: " + token);

Output Android:

status: -granted-
TOKEN BEFORE....

Output iPhone:

status: -granted-
TOKEN BEFORE....
TOKEN: ExponentPushToken[Xxxxx_Xxxxxxxxxxxxxx]
0 Answers
Related