码迷,mamicode.com
首页 > 移动开发 > 详细

IOS推送后页面跳转

时间:2016-04-07 23:25:50      阅读:402      评论:0      收藏:0      [点我收藏+]

标签:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
<br>
<br>    if (launchOptions)
<br>
<br>    {
<br>
<br>        [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
<br>
<br>        NSDictionary *userInfo = [launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
<br>
<br>        [self presentViewControllerWithUserInfo:userInfo];
<br>
<br>    }
<br>
<br>}
<br>
<br>
<br>
<br>//App状态为正在前台或者后台运行,那么此函数将被调用
<br>
<br>- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
<br>
<br>{
<br>
<br>   
<br>
<br>    if (application.applicationState != UIApplicationStateActive)
<br>
<br>    {
<br>
<br>
<br>
<br>        [self presentViewControllerWithUserInfo:userInfo];
<br>
<br>       
<br>
<br>    }
<br>
<br>}
<br>
<br>
<br>
<br>#pragma mark - 消息跳转页面
<br>
<br>- (void)presentViewControllerWithUserInfo:(NSDictionary *)userInfo
<br>
<br>{
<br>
<br>       //拿出你的消息内容,跳转即可~~
<br>
<br>[self.window.rootViewController presentViewController:fyfNavCtrl animated:YES completion:^{
<br>
<br>                    //
<br>
<br>                }];
<br>
<br>}

IOS推送后页面跳转

标签:

原文地址:http://www.cnblogs.com/jx66/p/5366094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!