关于点击推送消息打开app

2018-01-24  本文已影响475人  塞外神龙

官方链接:
https://developer.apple.com/documentation/uikit/uiapplicationdelegate#//apple_ref/occ/intfm/UIApplicationDelegate/application:didFinishLaunchingWithOptions:

// iOS 程序启动时总会调用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    self.window.rootViewController = [GFBTempRootVC new];
    
    //////// 可以把内容alert出来查看(这里我用了工程中封装好的,大家用系统的alert即可)////////////////
    CustomPopUpView *view = [[CustomPopUpView alloc]initWithFrame:AppWindow.frame WithPopUpViewType:PopUpViewPrompt WithTitle:@"launchOptions" WithPromptTitle:[launchOptions mj_JSONString] WithImage:nil];
    [AppWindow addSubview:view];
    return YES;
}

其中参数launchOptions为NSDictionary类型的对象,里面存储有此程序启动的原因。

上一篇 下一篇

猜你喜欢

热点阅读