So I have followed the suggestions of asking for permissions separately as per the code snippet below, however I am only getting permission for one of the permissions. To be precise, I am only being asked to grant the location permission, while the notifications request is being completely ignored.
registerLocationAndNotifications = async () => {
let status;
status = await Permissions.getAsync(Permissions.NOTIFICATIONS);
let statusNotifications = status.status;
console.log("Notifications Permissions: ", statusNotifications);
status = await Permissions.getAsync(Permissions.LOCATION);
let statusLocation = status.status;
console.log("Location Permissions: ", statusLocation);
if (statusNotifications !== "granted") {
console.log("Requesting Notification Permissions");
status = await Permissions.askAsync(Permissions.NOTIFICATIONS);
statusNotifications = status.status;
}
if (statusLocation !== "granted") {
console.log("Requesting Location Permissions");
status = await Permissions.askAsync(Permissions.LOCATION);
statusLocation = status.status;
}
if (statusNotifications !== "granted" || statusLocation !== "granted") {
console.log("Permissions not granted");
return;
}
console.log("Permissions Granted!");
I also created a new application and testing on the iOS simulator to make sure I start from ‘scratch’ (or am I really?). I have also repeated this with new applications, and still same issue. Refer to screenshots: