欢乐生肖_欢乐生肖官方 - 由欢乐生肖,欢乐生肖官方社主办的《欢乐生肖,欢乐生肖官方》是我国消费领域中一张全国性、全方位、大容量的综合性日报。其立足消费网投领域,依托轻工行业,面向城乡市场,最先发布相关的专业权威资讯。

iOS刚进入后台接受推送、打开推送调转到相应的界面

  • 时间:
  • 浏览:0

        selNavi.toolbar.hidden = YES;

- (void)pushData:(NSString *)positionId{

        if ([dic numberValueForKey:@"positionId"] !=0) {

3、找到当前的viewControllers数组,创建时要返回的二级页面加入栈中!

    [self setSelectedIndex:MainTabBarIndex_User];

-(void)pushDispanchPositionDetail:(NSNotification *)notify

刚进入后台的之后 消息处里之后 我用了本地推送!都可不还能不能 看我前边写的博客,为社 处里刚进入后台接收推送的案例,链接

        UIAlertView *art = [[UIAlertView alloc]initWithTitle:nil message:str delegate:self cancelButtonTitle:@"注销" otherButtonTitles: nil];

二、处里页面跳转功能

{

        NSMutableArray *mutArray = [NSMutableArray arrayWithArray:selNavi.viewControllers];

    if (notify.object&&![notify.object isEqualToString:@""]) {

/**

}

完整解释跳转代码

在tabbar的viewDidAppear措施

1、找到所进入的viewController的根导航Navigation;为社 让进行选中(self代表tabbar)  [self setSelectedIndex:MainTabBarIndex_User];

    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData

    }

   NSDictionary *optionsRemoteNotificationKey = [launchOptions dictionaryValueForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];

}

        NSString * positionIdString = [NSString stringWithFormat:@"%@",[dic numberValueForKey:@"positionId"]] ;

}

    });

    /**

说明:不可能 状况1都代表app不可能 之后 结束了时要重新启动,必须做本地存储,为社 让到tabbar页面的之后 取出该存储值的对应id为社 让进行跳转。状况2、3  ,App的tabbar页面不可能 占据 都可不还能不能 注册另两个多多多通知在2、3的状况之后 发送通知!

        NSLog(@"json解析失败:%@",err);

        [selNavi pushViewController:vc animated:YES];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushDispanchPositionDetail:) name:kString_DispantData object:nil];

    RootNavigationController* selNavi = [self.viewControllers objectAtIndex:MainTabBarIndex_User];

    if(err)

1、存储调转

}

    if (appDataString&&![appDataString isEqualToString:@""]) {

    /**二次启动获得推送点击信息,本地储存二次启动的内容 仿qq点击推送栏启动 by peter***/

    [self setSelectedIndex:MainTabBarIndex_User];

获取字典 launchOptions 中的 UIApplicationLaunchOptionsRemoteNotificationKey的key

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

    NSData *jsonData = [appData dataUsingEncoding:NSUTF8StringEncoding];

{

{

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

}

 措施接收

   NSDictionary *optionsRemoteNotificationKey = [launchOptions dictionaryValueForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];

2、为社 让延迟调转,不可能 初始化tababr的由于分析不延迟跳转会总出 调转不进去的状况;什么都做延迟跳转处里。

- (void)viewDidAppear:(BOOL)animated

    NSString * positionIdString = [dic stringValueForKey:@"positionId"];

        [[NSUserDefaults standardUserDefaults] setObject:nil forKey:kSavePushMessage];

 1、apns的之后 ,之后 结束了进程退出后台:启动的之后 可在 didFinishLaunchingWithOptions的launchOptions中处里;

2、通知跳转

{

        [selNavi pushViewController:vc animated:YES];

    /**为了验证第一次启动的之后 必须截获启动信息,加啊alert**/

- (void)viewDidLoad

另两个多多多就能点推送进入C,返回B,在返回所时要的tabbar的某个界面。

    NSDictionary *optionsRemoteNotificationKey = [[NSUserDefaults standardUserDefaults] objectForKey:kSavePushMessage];

{

   [selNavi pushViewController:vc animated:YES];

    NSString *appDataString = [optionsRemoteNotificationKey stringValueForKey:@"appData"];

 2、apns的之后 ,之后 结束了进程未退出后台:启动的之后 可在 didReceiveRemoteNotification的userInfo中处里;

    NSDictionary *dic = notification.userInfo;

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

    }

    NSString * str = [NSString stringWithFormat:@"%@",launchOptions];

}

        HDMyPositionViewController *myPositionVC = [[HDMyPositionViewController alloc]init];

        [self pushData:notify.object];

    });

    }else{

    [super viewDidAppear:animated];

}

        selNavi.viewControllers = [mutArray copy];

注册监听tabbar的viewDidLoad措施里边

    [[NSUserDefaults standardUserDefaults] setObject:optionsRemoteNotificationKey forKey:kSavePushMessage];

    });

 **/

    vc.positionId = [positionId longLongValue];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

            [[NSNotificationCenter defaultCenter] postNotificationName:kString_DispantData object:positionIdString];

        [mutArray insertObject:myPositionVC atIndex:1];

                                                          error:&err];

        [art show];

    }

    return YES;

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{

        HDMyPositionViewController *myPositionVC = [[HDMyPositionViewController alloc]init];

 注释:打开推送的这种措施:-peter

        }

    RootNavigationController* selNavi = [self.viewControllers objectAtIndex:MainTabBarIndex_User];

        [mutArray insertObject:myPositionVC atIndex:1];

#pragma mark observer Notification

    if (![positionIdString isEqualToString:@""]) {

    }

                                                        options:NSJSONReadingMutableContainers

    NSError *err;

 3、本地推送,未之后 结束了进程未退出后台(此方达为了处里消息刚进入后台之后 没有通知的状况):启动的之后 可在 didReceiveLocalNotification的notification中处里;

    HHPositionDetailC *vc = [[HHPositionDetailC alloc] init];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

    {

        [[NSNotificationCenter defaultCenter] postNotificationName:kString_DispantData object:positionIdString];

    HHPositionDetailC *vc = [[HHPositionDetailC alloc] init];

        selNavi.toolbar.hidden = YES;

        NSMutableArray *mutArray = [NSMutableArray arrayWithArray:selNavi.viewControllers];

    NSString *  appData = [userInfo stringValueForKey:@"appData"];

        selNavi.viewControllers = [mutArray copy];

    vc.positionId = [positionId longLongValue];

    **/