iOS Question Which #Entitlement for Critical Alerts

schimanski

Well-Known Member
Licensed User
Longtime User
Is there someone who is using the function 'critical alerts'? I got the permission from apple and made the new privisioning profile. But which entitlement do i have to use?
I tried it with the following, but seems not to work. The sub Application_PuchToken will fail, if i use both enttitlements. Also should be in the settings the new switch to allow the critical alerts.

Thanks for help.

B4X:
#Entitlement: <key>aps-environment</key><string>production</string>
#Entitlement: <key>com.apple.developer.usernotifications.critical-alerts</key><boolean>1</boolean>

B4X:
Sub Application_PushToken (Success As Boolean, Token() As Byte)
        Log($"PushToken: ${Success}"$)
End Sub
 

schimanski

Well-Known Member
Licensed User
Longtime User
I changed it to:
B4X:
#Entitlement: <key>aps-environment</key><string>production</string>                  
#PlistExtra: <key>com.apple.developer.usernotifications.critical-alerts</key><true/>

but no effect, even the sub Application_PushToken is true.
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
Well, according to this page...
...it says ”Critical alerts require a special entitlement issued by Apple.”, which indicates that you should be issued a special entitlement from Apple. So perhaps look in your communication from them?
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Thank you!
There are no additional informations in the communication with apple, just a new tab under the identifiers in the apple console with a switch button. I followed the instructions from the link, but there are some settings in xcode about which i don't know.


I was hoping that maybe someone has had experience with it.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
WHAT WE NEED TO ADD TO THE CODE
B4X:
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .badge, .sound, .criticalAlert]) { (granted, error) in}

I read all, which i found and i think we just need to request authorization. Is it not possible to implement it in b4i?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…