i have created an app for our local Fire Station with Push Notifications in emergency cases. This works as expected. Now the critical alerts entitlement request is approved by apple and i want to integrate this feature.
The problem is, i cant find a way to request the critical alert permission in app. I tried the following to get the permission...
const test = await Notifications.requestPermissionsAsync({
android: {},
ios: {
allowAlert: true,
allowBadge: true,
allowSound: true,
allowAnnouncements: true,
allowCriticalAlerts: true
}
})
console.log(test)
but in the request response i can see that "allowsCriticalAlerts": null, here is the response:
"ios": Object {
"alertStyle": 2,
"allowsAlert": true,
"allowsAnnouncements": null,
"allowsBadge": true,
"allowsCriticalAlerts": null,
"allowsDisplayInCarPlay": null,
"allowsDisplayInNotificationCenter": true,
"allowsDisplayOnLockScreen": true,
"allowsPreviews": 1,
"allowsSound": true,
"providesAppNotificationSettings": false,
"status": 2,
},
"status": "granted",
}
Anyone have an idea to get it working within an managed expo (sdk 42) app?
All configuration steps are completely ok. Nothing wrong. One day we get a new App user and he was asked after installation to receive critical alerts. So now i deleted my app complete from my phone and reinstalled it.
Thats it. Now i was getting the critical alerts request too and all works fine.
My configuration in app.json looks like this:
"ios": {
"infoPlist": {
"com.apple.developer.usernotifications.critical-alerts": 1
},
"entitlements": {
"com.apple.developer.usernotifications.critical-alerts": true
}
if apple granted your critical alerts request and your config is ok all have to work as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With