Setting sounds for local notifications on a 3G iPhone running iOS4

后端 未结 3 1183
日久生厌
日久生厌 2021-01-13 12:53

I have successfully scheduled local notifications in my app using the code below:

Class cls = NSClassFromString(@\"UILocalNotification\");

    if (cls != ni         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-13 13:28

    UILocalNotification does not support mp3. It only supports the formats and containers mentioned on the reference page.

    http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html

    Because custom alert sounds are played by the iOS system-sound facility, they must be in one of the following audio data formats:

      Linear PCM
      MA4 (IMA/ADPCM)
      µLaw
      aLaw
    

    You can package the audio data in an aiff, wav, or caf file.

提交回复
热议问题