开发者

UILocalNotification and iOS 4.2

开发者 https://www.devze.com 2023-01-28 17:03 出处:网络
guys :) I\'m using local notification in my application and I provide action for the UILocalNotification so that the user can open the application when the notification fires. I\'m pretty sure that be

guys :) I'm using local notification in my application and I provide action for the UILocalNotification so that the user can open the application when the notification fires. I'm pretty sure that before iOS 4.2, when the user taps the action button, the alert sound was stopped immediately. But when I run my application on iOS 4.2 simulator, the sound plays until it reaches its end, which is very bad for me, because the sound file is pretty long - around 30 seconds. I don't want to shorten the alert sound, because it's an alarm application. But if the u开发者_如何学Goser clicks the "Close" button of the local notification alert view, the sound is stopped at the very same moment. Do you know if there is any workaround to stop the alarm sound when the user clicks the action button? Huge thanks in advance, I'm really looking forward for your advices. Happy coding :)


This appears to be a bug in iOS 4.2 (and not just in the simulator). I can't find any way to cancel a sound in mid-playback, as canceling the notification doesn't do it.


I stabbing in the dark on this one, but can you play a "silent" sound when the user clicks the action button? Thereby overriding the currently playing sound?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号