Hi guys,
today i update my phone to public beta test of iOS 12 and the permissions for notifications always return undetermined
.
This works as expect on iOS 11 my code (im using SDK 28), my code did not change and the permissions were accepted correctly.
The method I use is the same one that is published in your documents:
https://docs.expo.io/versions/latest/guides/push-notifications#1-save-the-users-expo-push-token
Here the example code (look the comments within the code):
async function registerForPushNotificationsAsync() {
const { status: existingStatus } = await Permissions.getAsync(
Permissions.NOTIFICATIONS
);
// existingStatus returns "undetermined", EVEN IF THE PERMISSIONS HAVE BEEN ACCEPTED
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
// status returns "undetermined", EVEN IF THE PERMISSIONS HAVE BEEN ACCEPTED
finalStatus = status;
}
if (finalStatus !== 'granted') {
return;
}
// ...
}
Thanks !!!