After I send a push notification I want the app to open on my inbox page so the user can see the new messages on the inbox. I have the following code in my AppDelegate
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
[self.tabController setSelectedIndex:2];
}
When I send a push message and the phone is active it goes straight there without warning. I know thats what it is supposed to do with my code but is there a way to change it like so
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
if(app.isActive == FALSE)
[self.tabController setSelectedIndex:2];
}
Any insight on this will help greatly. Thanks!
From Stanislav Yaglo, Objective C: How to check if application is currently active (i.e. user is using it)? :
Hope it helps !