Limits on iPhone push notification sounds?

折月煮酒 提交于 2019-12-05 15:12:11

问题


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?


回答1:


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.




回答2:


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




回答3:


You may have to consider "Notification Payload" for that.You can also have Custom Alert Sounds. See this:Notification Payload




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/1463599/limits-on-iphone-push-notification-sounds

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