iPhone 推送通知自定义声音,静音模式下没有振动? [英] iPhone Push Notifications Custom Sound, no Vibrate in silent mode?

查看:47
本文介绍了iPhone 推送通知自定义声音,静音模式下没有振动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我的应用程序使用自定义声音推送通知工作正常.但是,当我的iPhone处于静音模式时,我发送带有自定义声音的推送通知时,声音显然没有播放,但也没有振动.

如果我发送带有 sound="chime" 或类似内容的推送通知,iPhone 的 SMS 通知声音会按预期播放,而在静音手机中,它会按预期振动.

我在这里做错了什么?

解决方案

万一其他人遇到这个问题,我终于想通了.

实际上是在苹果的尽头.如果你发送一个有声音的推送通知,只有徽章,但没有文字提醒,如果你的手机没有处于静音模式,它会播放声音,但如果你的手机处于静音模式,它不会播放声音.

现在,如果您向该通知添加文本提醒,即使在振动模式下,它也能正常播放声音.

可能还有更多的测试要做.例如:如果您发送自定义键/值对,它会播放声音吗?不确定.

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?

解决方案

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.

这篇关于iPhone 推送通知自定义声音,静音模式下没有振动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆