iOS 融云远程推送

融云远程推送点击一直闪退,找不到原因,因为程序刚启动是获取当前控制器的方法返回的控制器是nil,融云也没有初始化,在

-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler


点击推送的方法里使用        [self performSelector:@selector(messageMethod) withObject:@"message" afterDelay:2.0];延迟2秒,再根据当前控制器跳转到聊天界面就可以了


       RCConversationViewController *vc= [[RCConversationViewController alloc]initWithConversationType:ConversationType_PRIVATE targetId:[NSString stringWithFormat:@"%@",  self.targetId]];

            vc.titleStr=@"聊天";

        UIViewController *rootVC = [self findCurrentShowingViewController];


            [rootVC.navigationControllerpushViewController:vcanimated:YES];

你可能感兴趣的:(iOS 融云远程推送)