question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android emulator Permissions.askAsync(Permissions.NOTIFICATIONS) returns granted

See original GitHub issue

Environment

expo v26 & v27 Genymotion Android Emulator

Steps to Reproduce

Everything works fine on expo 25, Permissions.askAsync(Permissions.NOTIFICATIONS) returns status undetermined on Android emulator and iOS simulator. Problem started after updating expo to v26 and v27. iOS works fine but not Android. On Android emulator notification status is granted and Notifications.getExpoPushTokenAsync never resolves.

Expected Behavior

Permissions.askAsync(Permissions.NOTIFICATIONS) returns status different than granted and Notifications.getExpoPushTokenAsync is never executed.

Actual Behavior

Permissions.askAsync(Permissions.NOTIFICATIONS) returns status granted and Notifications.getExpoPushTokenAsync is executed and never resolves.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
colinyoungcommented, May 9, 2018

There seems to have been a somewhat undocumented change in the askAsync/getAsync where the Expo Client 27 is now asking you to grant permission again for each individual Expo app (slug). It would be great to have this more documented/called out in this ticket

0reactions
idecommented, Oct 3, 2018

Locking this thread so we don’t have stale issues or problems with the same symptoms but different root causes in the same thread. As @sjchmiela said, please feel free to open a new thread if you encounter this problem with the latest Expo SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notification runtime permission - Android Developers
Your app must wait to send notifications until after you request the new permission and the user grants that permission to your app....
Read more >
Permissions.askAsync(Permissions.CAMERA) always denied ...
On Android, the canAskAgain permission always returned false (I haven't got around to ios).I found a workaround for my issue that may be ......
Read more >
How to use the expo-permissions.NOTIFICATIONS function in ...
askAsync (Permissions.NOTIFICATIONS); finalStatus = status; } // Stop here if the user did not grant permissions if (finalStatus !== 'granted') { return null ......
Read more >
React Native Push Notifications - DEV Community ‍ ‍
askAsync (Permissions.NOTIFICATIONS) to get permission from the user. If the user does not provide the permission, then we throw an error.
Read more >
React Native: Adding Push Notifications to your App with Expo
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); if (status !== 'granted') { return; }
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found