Critical alerts: backwards compatibility

Hello,

I'm succesfully testing critical alerts to iOS12 devices. If the user disable critical alerts the notification is received as a normal push notifications.

However on pre-iOS12 devices the notifications are always received silently, regardless of users settings. I testted this on a device with iOS10.x.


To reproduce the problem just send this notification on a pre-iOS12 device:

{"aps":{"alert": { "title":"mytitle","body":"mybody" }, "badge":99, "sound": { "name":"default", "critical":1, "volume":1.0} }}


no sound will be played. This seems to happen anytime I use a dictionary for the sound property, regardless of the "critical" flag.

How should backwards compatibility with older devices be handled ?


Thanks!

That's an excellent question. When sending your device token to your server, you could also send a flag indicating if the device was capable of receiving critical alerts.


I also suggest filing a bug report about this at <https://developer.apple.com/bug-reporting>. The challenge is if the only way to make this work would require code changes to older iOS versions without any way to get those changes to affected users.


--gc

Critical alerts: backwards compatibility
 
 
Q