且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iPhone推送通知自定义音效,在静默模式下无震动?

更新时间:2023-02-26 21:27:30

在万一别人运行到这一点,我想通了最后。

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.