I need to show a notification modal whenever a push notification is received (while the app is running). My app has a tab bar, and I've gotten this to partially work by pushing the notification modal onto the tab bar controller.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
NotificationViewController *vc = [[NotificationViewController alloc] init];
[tabBarController presentModalViewController:vc animated:YES];
[vc release];
}
This seems to fail, however, when there is already a different modal open that hides the tab bar controller. What is the best way to make sure that the NotificationViewController always displays when a push notification is received, even if there is already a modal open that is hiding the tab bar controller?