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

后端 未结 3 1177
日久生厌
日久生厌 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:25

    There could be a couple of reasons:

    1. Is your sound file included in your bundle? (most likely, seeing as it works on the simulator)
    2. The Apple documentation says to not use compressed audio formats. See the link here. The reason for this being that the iPhone hardware can only play one compressed audio file at a time, and so it is not recommended to use one for the alarm as well, in case the user is already listening to a song from iTunes.

提交回复
热议问题