1,自己启动(用户手动点击启动)
2,urlscheme启动(关于urlScheme的详解点击打开链接)
3,本地通知启动 (自己写的本地通知启动,蓝牙模块的启动,地理围栏的启动)
4,远程通知启动 (后台服务器的推送通知)
- (BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
// Override point for customization after application launch.
//用户自己点击启动
if(!launchOptions)
{
NSLog(@"用户点击app启动");
}
else
{
NSURL*url = [launchOptionsobjectForKey:UIApplicationLaunchOptionsURLKey];
//app 通过urlscheme启动
if(url) {
NSLog(@"app 通过urlscheme启动 url = %@",url);
}
UILocalNotification*localNotification = [launchOptionsobjectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
//通过本地通知启动
if(localNotification)
{
NSLog(@"app 通过本地通知启动 localNotification = %@",localNotification);
}
NSDictionary*remoteCotificationDic = [launchOptionsobjectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
//远程通知启动
if(remoteCotificationDic)
{
NSLog(@"app 通过远程推送通知启动 remoteCotificationDic = %@",remoteCotificationDic);
}
}
returnYES;
}
网友评论