XCode : why launchOptions in didFinishLaunchingWithOptions always nil?

前端 未结 4 1947
时光取名叫无心
时光取名叫无心 2020-12-09 18:35

I want my app to do specific things when the app is launched by a click on a notification. I want to do these specific things when the app is already running into background

4条回答
  •  旧时难觅i
    2020-12-09 19:11

    Dont know if this is what your looking for, but are you missing 'return YES;'? Because i use this to perform a segue to a new view from a notification and it works fine

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        UINavigationController *navigation = (UINavigationController *) self.window.rootViewController;
    
        [navigation.visibleViewController performSegueWithIdentifier:@"Ident" sender:nil];
    
        return YES;
    }
    

提交回复
热议问题