Open specific view on receiving Push Notification?

First of all, this question is not really related to push notifications at all. It's more a question of how to access your view controllers from an arbitrary place in your application delegate Your best (and possibly only) bet is to manually keep references to the relevant view controller instances I'm assuming you use a UINavigationController where the root is your list, and then you push a detail view controller onto it. Keep a reference to this navigation controller in your app delegate.

Add a property (nonatomic, retain) UINavigationController *mainNavController to your application delegate. When you create the navigation controller, assign it so the app delegate has a reference MyAppDelegate *ad = ((MyAppDelegate *)UIApplication sharedApplication. Delegate); ad.

MainNavController = theNavController If you create the navigation controller in the app delegate itself, you obviously only need to do this: self. MainNavController = theNavController Then when you receive a push notification, simply act on the navigation controller directly (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { // Do whatever you need to do in order to create an instance of your // detail view controller MyDetailViewController *vc = MyDetailViewController magicalStuff:userInfo; // Add the detail view controller to the stack, but keep the root view // controller. UIViewController *root = self.

MainNavController. TopViewController; NSArray *vcs = NSArray arrayWithObjects:root, vc, nil; self. MainNavController setViewControllers:vcs animated:YES; } Then the navigation controller will animate to MyDetailViewController with a swipe and the back button will take you to the list.

First of all, this question is not really related to push notifications at all. It's more a question of how to access your view controllers from an arbitrary place in your application delegate. Your best (and possibly only) bet is to manually keep references to the relevant view controller instances.

I'm assuming you use a UINavigationController where the root is your list, and then you push a detail view controller onto it. Keep a reference to this navigation controller in your app delegate. Add a @property (nonatomic, retain) UINavigationController *mainNavController; to your application delegate.

When you create the navigation controller, assign it so the app delegate has a reference. MyAppDelegate *ad = ((MyAppDelegate *)UIApplication sharedApplication. Delegate); ad.

MainNavController = theNavController; If you create the navigation controller in the app delegate itself, you obviously only need to do this: self. MainNavController = theNavController; Then when you receive a push notification, simply act on the navigation controller directly. - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { // Do whatever you need to do in order to create an instance of your // detail view controller MyDetailViewController *vc = MyDetailViewController magicalStuff:userInfo; // Add the detail view controller to the stack, but keep the root view // controller.

UIViewController *root = self. MainNavController. TopViewController; NSArray *vcs = NSArray arrayWithObjects:root, vc, nil; self.

MainNavController setViewControllers:vcs animated:YES; } Then the navigation controller will animate to MyDetailViewController with a swipe and the back button will take you to the list.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions