//
// AppDelegate.m
// 0117-本地通知
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
UILocalNotification *note = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
if (note) {
//点击本地通知启动的程序
}else{
//直接点击App图标启动的程序
}
return YES;
}
/**
* 当用户点击本地通知进入App的时候调用(App当时并没有被关闭)
*/
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
//程序正处于前台运行,直接返回
if(application.applicationState == UIApplicationStateActive) return;
//点击通知再次回到前台
}
@end
UILocalNotification本地通知02
最新推荐文章于 2016-12-04 23:30:43 发布