美文网首页iOS
判断APP的启动方式

判断APP的启动方式

作者: 木子Charles | 来源:发表于2016-03-28 17:18 被阅读147次

#pragma mark -┏━━━━━━━━━━━━━━━━启动APP的方式━━━━━━━━━━━━━━━━━┓

    if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
#pragma mark - 1.远程通知 launch app
        NSLog(@"%@",launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]);
    }else if (launchOptions[UIApplicationLaunchOptionsURLKey]&&launchOptions[UIApplicationOpenURLOptionsSourceApplicationKey]){
#pragma mark - 2.其他应用 launch app
        NSLog(@"%@\n%@",launchOptions[UIApplicationLaunchOptionsURLKey],launchOptions[UIApplicationOpenURLOptionsSourceApplicationKey]);
    }else if (launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]){
#pragma mark - 3.本地通知 launch app
        NSLog(@"%@",launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]);
    }else if(!launchOptions){
#pragma mark - 4.点击Icon launch app
        NSLog(@"点击Icon启动");
    }else{}

#pragma mark -┗━━━━━━━━━━━━━━━━启动APP的方式━━━━━━━━━━━━━━━━━┛

相关文章

网友评论

    本文标题:判断APP的启动方式

    本文链接:https://www.haomeiwen.com/subject/vfwjlttx.html