How can I create iOS push notifications that don’t vibrate?

前端 未结 5 1958
终归单人心
终归单人心 2021-01-02 09:29

I know how to create silent push notifications (with playing a sound file that is silent). I would also like to send a push notification that doesn\'t vibrate phone.

5条回答
  •  情书的邮戳
    2021-01-02 10:17

    Omitting the sound key should do the trick:

    {"aps":{"alert":{"loc-key":"SOME_KEY"}, "badge":1}
    

    The docs state that "If the sound file doesn’t exist or default is specified as the value, the default alert sound is played.". What they don't say is that if you don't provide a sound key at all, no sound will be played. If no sound is played, the phone should not vibrate as well.

提交回复
热议问题