I have an application that sets an alarm for a user. Alarm is a basic UILocalNotification with an audio file that is 12 seconds long. Sound is played on the device, but it does not disappear when use rejects the notification. I got it to stop the sound on the simulator using this
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
[[UIApplication sharedApplication] cancelLocalNotification:localNotif];
}
return YES;
}
Any help would be great.
thank
source
share