summaryrefslogtreecommitdiff
path: root/Juick/AppDelegate.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-08 12:15:17 +0300
committerGravatar Vitaly Takmazov2018-04-08 12:15:17 +0300
commit2a4770c84aaf2be9c58622f108007facef670fd3 (patch)
treec8178619c2484618a5aec100394fc47e82075757 /Juick/AppDelegate.m
parent80239775563a1b29136ee64c29c2379a95e504c2 (diff)
PM pushes
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r--Juick/AppDelegate.m13
1 files changed, 10 insertions, 3 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index e2eebe5..7cfd052 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -86,15 +86,22 @@
NSLog(@"User Info : %@", userInfo);
[self parseNotificationPayload:userInfo];
UITabBarController *main = (UITabBarController *)self.window.rootViewController;
- [main setSelectedIndex:0];
- UINavigationController *discover = (UINavigationController *)[main.viewControllers objectAtIndex:0];
- [[discover.viewControllers objectAtIndex:0] performSegueWithIdentifier:@"threadViewSegue" sender:discover];
+ if (self.pushedThread > 0) {
+ [main setSelectedIndex:0];
+ UINavigationController *discover = (UINavigationController *)[main.viewControllers objectAtIndex:0];
+ [[discover.viewControllers objectAtIndex:0] performSegueWithIdentifier:@"threadViewSegue" sender:discover];
+ } else {
+ [main setSelectedIndex:1];
+ UINavigationController *dialogs = (UINavigationController *)[main.viewControllers objectAtIndex:1];
+ [[dialogs.viewControllers objectAtIndex:0] performSegueWithIdentifier:@"chatSegue" sender:dialogs];
+ }
completionHandler();
}
-(void) parseNotificationPayload:(NSDictionary *)userInfo {
if (userInfo != nil) {
self.pushedThread = [userInfo objectForKey:@"mid"];
+ self.pushedUname = [userInfo objectForKey:@"uname"];
}
}