iPhone Push Notifications Custom Sound, no Vibrate in silent mode?

北城以北 提交于 2019-12-04 15:12:48

问题


So, I have Push Notifications working fine to my app with Custom Sounds. However, when my iPhone is in silent mode, and I send a push notification with a custom sound, the sound obviously does not play, but there is also no vibration.

If I send a push notification with a sound="chime" or something that doesn't exist like that, the iPhone's SMS notification sound plays as expected, and in silent phone, it vibrates, as expected.

What am I doing wrong here?


回答1:


In case anyone else runs into this, I figured it out finally.

It's actually on Apple's end. If you send out a push notification with a sound, and badge only, but no text alert, it will play the sound if your phone is not in silent mode, however it will NOT play the sound if it IS in silent mode.

Now, if you add a text alert to that notification, it plays the sound fine, even while in vibrate mode.

There may be some more testing to be done around this. Eg: if you send custom key/value pairs does it play the sound then? Not sure.



来源:https://stackoverflow.com/questions/1359818/iphone-push-notifications-custom-sound-no-vibrate-in-silent-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!