I am facing issue in launch of particular application page when user will get push notification in ios.
is this possible to do?
if yes, can you please help me in that.
I am facing issue in launch of particular application page when user will get push notification in ios.
is this possible to do?
if yes, can you please help me in that.
You could send a notification to yourself when you get any remote notification and by registering the UIViewController
to this notification, you could open a particular UIViewController
once notification is received.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
[[NSNotificationCenter defaultCenter] postNotificationName:@"pushNotification" object:nil userInfo:userInfo];
}
In your FirstViewController.m register for listening to this notification.
-(void)viewDidLoad{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushNotificationReceived) name:@"pushNotification" object:nil];
}
Inside the method you could open particular viewController
-(void)pushNotificationReceived{
[self presentViewController:self.secondViewController animated:YES completion:nil];
}
Finally un-register current viewController from notification in dealloc method
-(void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
Let me know if you face any problem with this.