【发布时间】:2016-01-28 12:19:36
【问题描述】:
我正在练习在 IOS 7 上开发警报应用程序,例如警报。 Alarm time up on IOS7 但是,我在锁定屏幕时停留在本地通知,就像这样。 My notification 我做的一些代码:
在我的 AppDelegate.m 中
我的代码
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
// Handle launching from a notification
UILocalNotification *locationNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
....
..in my ViewController.m..
[self scheduleLocalNotificationWithDate:correctDate];
....
(void)scheduleLocalNotificationWithDate:(NSDate *)fireDate {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = fireDate;
localNotification.alertBody = [NSString stringWithFormat:@"Alert Fired at %@", fireDate];
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = numberReminder;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
谁能帮忙?
谢谢
【问题讨论】:
标签: objective-c localnotification