自定义的iOS推送通知的声音 [英] Custom iOS push notification sound
问题描述
我一直面临的一个问题。我实现推送通知iOS中使用自定义音效。它是一个MP3文件。它打得很好,当我收到的iOS 5推送通知,但在iOS4的,它不播放任何声音。
你能不能帮我?
I have been facing an issue. I implemented push notification in iOS with custom sound. Its a MP3 file. It plays well when I receive a push notification in iOS 5, but in iOS4, it doesn't play any sound. Can you help me with this?
在code是这样
{
"aps": {
"badge": 10,
"alert": "Hello",
"sound": "sound.mp3"
}
}
Nithin
Nithin
推荐答案
据该推送通知指南:
您可以在AIFF,WAV或CAF文件包中的音频数据。然后,在
X code,声音文件添加到您的项目作为非本地化资源
的应用程序包。
You can package the audio data in an aiff, wav, or caf file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle.
这并不是说有关的MP3什么。我用它的AIF文件的工作。我会坚持到什么<一个href=\"https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6\"相对=nofollow>苹果指定。
It doesn't say anything about MP3s. I've used aif files which worked. I'd stick to what Apple specifies.
这篇关于自定义的iOS推送通知的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!