iOS critical alert through FCM

后端 未结 2 2106
别跟我提以往
别跟我提以往 2021-01-15 06:08

iOS 12 has added critical alerts. The APNS payload has the sound dictionary to support critical alerts. Is there an equivalent sound dictionary support in FCM payload to sen

2条回答
  •  臣服心动
    2021-01-15 06:52

    There is currently no sound dictionary support in FCM which is equivalent to iOS' sound dictionary. As I'm sure you're already aware of, the counterpart of FCM with APNs' when it comes to sound is the sound parameter:

    The sound to play when the device receives the notification.

    Sound files can be in the main bundle of the client app or in the Library/Sounds folder of the app's data container. See the iOS Developer Library for more information.

    However, reading from the UNNotificationSound docs, maybe you could try adding a data message payload that contains an identifier (e.g. "isCritical": "true") then have your app handle it as needed.

提交回复
热议问题