Firebase FCM silent push notifications for iOS

后端 未结 4 1770
花落未央
花落未央 2020-12-03 05:31

I have a problem with silent notifications on iOS.

When my application is in background, I don\'t receive silent notification sent by FCM. But if I try to send direc

4条回答
  •  遥遥无期
    2020-12-03 05:45

    I found an workaround. I put an empty value for "sound" in "notification" field and the silent notifications are delivered even when the application is in background.

    { 
        "to" : "...",
        "priority": "high",
        "notification": {
            "sound": ""
        },
        "data" : {
          ....
        }
    }
    

    My hunch is that Apple does not allow silent notifications with a 'high' priority and somehow "notification": {"sound": ""} tricks the APNS that this notification is not a silent one.

提交回复
热议问题