0

내 VC가 MMDrawerController에 포함 된 프로젝트가 있습니다. 문제 appdelegate에서 푸시 알림을 받았지만 알림을받은 특정 화면을 어떻게 열 수 있는지 알 수 없습니다. VC를 centerVC로 만드는 것은 작동하지 않습니다. 내 화면에는 일부 화면에는 뒤로 버튼이 있기 때문에 유용하지 않습니다. 또한mmdrawerController를 사용하는 경우 원격 알림을위한 특정 화면을 열려면 어떻게해야합니까?

[_drawerController.centerViewController.navigationController pushViewController:pushedVC animated :true] 

을 사용하고 있지만 쓸모 그것은 화면에 영향을주지 않습니다. 도움이 필요하시면 미리 알려 주시기 바랍니다.

여기에, 나는 또한있는 그 화면에 리디렉션 할 수있어, 라인 아래이 사용한 // 내가 ChatVC

-(void)GotoChatVCNotification{ 
UIColor *navBarColor = [UIColor colorWithRed:52.0/255.0 green:56.0/255.0 blue:52.0/255.0 alpha:1.0]; 
[[UINavigationBar appearance] setBarTintColor:navBarColor]; 
NSDictionary *titleDict = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName, nil]; 
[[UINavigationBar appearance] setTitleTextAttributes:titleDict]; 
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle: nil]; 

ChatVC *centerViewController = [storyBoard instantiateViewControllerWithIdentifier:@"ChatVC"]; 
centerViewController.User_id = [APPDELEGATE.userDetailsDic objectForKey:@"user_id"]; 
_otherUserID=[self.dicPushData valueForKey:@"sender_id"]; 
centerViewController.Reciever_id = [self.dicPushData valueForKey:@"sender_id"]; 
[email protected]"notification"; 
centerViewController.strFriendId = [self.dicPushData valueForKey:@"sender_id"]; 
centerViewController.strProjectId = [self.dicPushData valueForKey:@"project_id"]; 
centerViewController.strChatUserName = [self.dicPushData valueForKey:@"full_name"]; 
centerViewController.strSupportChat = @"Chat"; 

[[APPDELEGATE.sideController.centerViewController navigationController] popToRootViewControllerAnimated:false]; 

[[APPDELEGATE.sideController.centerViewController navigationController] pushViewController:centerViewController animated:false]; 

로 이동 AppDelegate에에서 사용하고 내 코드입니다 하지만 내 MMDrawerController의 Fictionality는 거기에 없습니다. // [[self topMostController] presentViewController : centerViewController animated : NO completion : nil];}

답변

0

다음과 같은 방법으로 시도해 볼 수 있습니다.

당신이 MMDrawerController'scenterViewController 위에 밀려있어 다른 화면에있는 경우에, 당신은 다음과 같은 시도 할 수 있습니다 : 위의 코드는 당신이에 대한 추가 정보를 원하는하지 않는 것이 가정입니다

// Assuming you have access to _drawerController 

// The below line is to remove any UIViewController on top of center 

[[_drawerController.centerViewController navigationController] popToRootViewControllerAnimated:false]; 

// _screenToBeRedirectedTo is the UIViewController you want to be redirected to 

[[_drawerController.centerViewController navigationController] pushViewController:_screenToBeRedirectedTo animated:false]; 

_screenToBeRedirectedTo 화면으로 리디렉션

편집

당신은 당신이 가지고있는 제약 조건을 지정할 수 있습니다 경우에, 나는 더 detaile를 제공 ​​할 수 있습니다 대답. 의심스러운 점이 있으면 언제든지 댓글을 남길 수 있습니다 :)

+0

thankyou! 빠른 응답을 위해 그것이 나를 위해 일하지 않고있다. 그것은 뷰 컨트롤러를 rootVC까지 터트려 있지만 그 후에는 내 _screenToBeRedirectedTo 화면을 누르지 않고 있습니다. – Amit

+0

@Amit, – KrishnaCA

+0

@Amit을 확인하겠습니다.이 줄을 사용하고 있는지 말해 주시겠습니까? [_drawerController.centerViewController navigationController] popToRootViewControllerAnimated : false]'또는이 하나 [_drawerController.centerViewController navigationController] popToRootViewControllerAnimated : true]' – KrishnaCA