是否有可能从时通报交付停止播放UILocalNotification的声音? [英] Is it possible to stop the sound of a UILocalNotification from playing when the notification is delivered?

查看:182
本文介绍了是否有可能从时通报交付停止播放UILocalNotification的声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个UILocalNotification火灾具有完善的集,用户点击该通知提醒取消,声音将停止。但是,如果用户点击查看,然后iOS的通知传递到应用程序和声音不断播放。有什么办法取消这个声音来自应用程序?取消在应用程序的通知,一旦通知交付不工作(我没指望它,通知已经毕竟交付),因为我没有健全的系统声音ID(我没'T分配它摆在首位),我不能叫AudioServicesDisposeSystemSoundID(可以吗?)。

If a UILocalNotification fires with a sound set, and the user taps "Cancel" on the notification alert, the sound is stopped. But if the user taps "View", iOS then delivers the notification to the app and the sound keeps on playing. Is there any way to cancel this sound from the app? Canceling the notification in the app once the notification is delivered doesn't work (I didn't expect it to, the notification has already been delivered after all), and since I don't have the sound's system sound ID (and I didn't allocate it in the first place), I can't call AudioServicesDisposeSystemSoundID (can I?).

是否有可能,如果用户点击该通知的警报的动作按钮,停止播放UILocalNotification声音?

Is it possible to stop a UILocalNotification sound from playing if the user taps the Action button of the notification's alert?

推荐答案

显然,问题只存在于模拟器(iOS 4.2的SDK),而不是实际的设备上。

Apparently the problem only exists on the simulator (iOS 4.2 sdk), not on the actual device.

这篇关于是否有可能从时通报交付停止播放UILocalNotification的声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆