Notifications permissiosn - no popup

Please provide the following:

  1. SDK Version: 38
  2. Platforms(Android/iOS/web/all): android

Demo
Init default expo project, install expo-permissions, add

    "android": {
      "useNextNotificationsApi": true
    }

Add this code to App.js

  useEffect(() => {
    (async function () {
      try {
        await Permissions.askAsync(Permissions.NOTIFICATIONS);
      } catch (error) {
        console.log(error);
      }
    })();
  }, []);

I’m never asked about the permissions, when I change the NOTIFICATIONS to something else, for example CAMERA, CALENDAR, it’s working fine, I tried code from here Notifications - Expo Documentation but then I’m always getting this alert alert('Failed to get push token for push notification!');, I tried starting local metro bundler and connect to it via qr code, and building standalone app, but I’ve never been asked about notifications permissons.

Hey @roberts98,

Can you provide me with a reproducible example I can clone from github or a Snack? I can’t seem to reproduce this on my end as I’ve gotten the permission prompt to show.

Cheers,
Adam

The problem still occurs, I’m getting permission prompt for all types, except notifications.

Can you make sure you haven’t already granted or declined the permissions in the project? On iOS, an alert will no longer appear once you have granted or declined them. Console logging the value returned from the askAsync method should reveal if this is the case.

I’m using the android, I tried to enabling and disabling notifications in app settings, but I was never asked about granting permissions.

I tried also the code from here:

When I disable notifications in app settings I’m always getting this alert

Failed to get push token for push notification!

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