iPhone 推送通知声音有限制吗?
有人知道 iPhone 应用程序收到推送通知时可以播放的声音有什么限制吗?具体来说,有最大声音长度吗?
另外,我假设声音的音量将与用户设置的铃声音量相匹配,如果设置为振动模式,手机将振动而不是播放声音。这是正确的吗?
Does anybody know of any limitations on the sounds that can be played when an iPhone app receives a push notification? Specifically, is there a maximum sound length?
Also, I am assuming that the volume of the sound will match whatever the user has set their ringer volume to, and if set to vibrate mode, the phone will vibrate instead of playing a sound. Is this correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我测试了推送通知音频警报的最大长度,毫不奇怪,结果是 30 秒。任何较长的音频文件都会导致播放内置的三音警报。
I have tested the maximum length of a push notification audio alert, which not surprisingly turned out to be 30 seconds. Any longer audio files will result in the built-in Tri-tone alert being played instead.
我不确定,但根据各种 API 限制,我猜测长度为 30 秒。最大限度。是的,铃声的音量就是声音的音量。与振动模式相同
I don't know for sure, but based on various API limitations I would guess the length would be 30 sec. max. And yes, the volume of the ringer is the volume of the sound. Same with vibrate mode
您可能必须为此考虑“通知有效负载”。您还可以拥有自定义警报声音。
请参阅:通知负载
You may have to consider "Notification Payload" for that.You can also have Custom Alert Sounds.
See this:Notification Payload
更新了对 Apple 文档的引用 30 秒。
https://developer.apple.com/library/prerelease/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW10
Updated reference to Apple's documentation for 30 seconds.
https://developer.apple.com/library/prerelease/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW10
以下是 Apple 文档中的参考(30 秒是正确的): https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/文档/uid/TP40008194-CH103-SW6
Here's the reference in Apple's documentation (30 seconds is correct): https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6