vibrate in push notification

前端 未结 4 506
别跟我提以往
别跟我提以往 2020-12-06 04:58

How can I set that device should vibrate if a push notification come to my application?

4条回答
  •  孤街浪徒
    2020-12-06 05:35

    I just figured out one way to do this: if you want to phone to only vibrate on receipt of a push notification, you need to have a silent sound file in your application bundle, for example "silence.aif" ... if you specify that sound file in the APS notification, the iOS device will "play" the silence.aif from your application bundle, but since the sound is silence, there is nothing to hear. However the notification vibration is still triggered :-)

提交回复
热议问题