标签:launch option 启动 推送 应用调用
launchOptions中的可能键值见UIApplication Class Reference的Launch Options Keys节 。
代码区分不同的启动,如点击推送可以做出跳转
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURL *url = [options objectForKey:UIApplicationLaunchOptionsURLKey]; if(url) { //由其他应用程序通过openURL:启动 } NSString *bundleId = [options objectForKey:UIApplicationLaunchOptionsSourceApplicationKey]; if(bundleId) { //对应启动的源应用程序的bundle ID (NSString) } UILocalNotification * localNotify = [options objectForKey:UIApplicationLaunchOptionsLocalNotificationKey]; if(localNotify) { //点击本地推送进来后 } NSDictionary * userInfo = [options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; if(userInfo) { //点击推送进来后 } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
iOS App Launch Option(附点击推送操作)
标签:launch option 启动 推送 应用调用
原文地址:http://blog.csdn.net/jueyi1127/article/details/48051449