2
我有一个应用程序,将为用户设置一个警报。该警报是一个基本的UILocalNotification,其声音文件长度为12秒。声音在设备上播放,但在使用关闭通知时不会消失。我得到它停止使用此模拟器上播放声音UILocalNotification停止声音后通知被解雇
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
[[UIApplication sharedApplication] cancelLocalNotification:localNotif];
}
return YES;
}
任何帮助将是伟大的。
谢谢
它没有为我工作。 :(声音仍在持续播放30秒。 – ScarletWitch 2014-07-02 09:40:38
为什么要取消所有通知?这不是一个解决方案,如果是的话,那是非常糟糕的。 – SergioM 2014-07-23 01:10:46