Notifications - getAsync gives granted, Notifications.getExpoPushTokenAsync throws error.

Hi there,

I am using expo 30.0.0, The push notifications were working till version < 28.0.0, after upgrades to 30.0.0, here is the behavior…

async function registerForPushNotificationsAsync() {
    const { status: existingStatus } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
    let finalStatus = existingStatus;
    alert("registerForPushNotificationsAsync1 "+finalStatus);
    // only ask if permissions have not already been determined, because
    // iOS won't necessarily prompt the user a second time.
    if (existingStatus !== '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;
      alert("registerForPushNotificationsAsync2 "+finalStatus);
    // Stop here if the user did not grant permissions
    if (finalStatus !== 'granted') {
        return new Promise((resolve,reject)=>{
    // Get the token that uniquely identifies this device
        let token = await Notifications.getExpoPushTokenAsync();
        token = (typeof token ==='string')?token:"no-token";
        // POST the token to your backend server from where you can retrieve it to send push notifications.
        return new Promise((resolve,reject)=>{
        return new Promise((resolve,reject)=>{

The existingStatus coming as “granted” from getAsync call. there after Notifications.getExpoPushTokenAsync() throws exception “This app does not have permission to show notifications”.

Not sure about next steps to resolve. Am I doing something incorrect or something missing?

Please help.

thanks in advance.

1 Like

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