From fe136b8c6b1e97fbc08f50265d41e1280c94afe3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 10 Dec 2017 12:52:02 +0300 Subject: another push fix --- Juick/AppDelegate.m | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Juick/AppDelegate.m') diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index e4056e6..43494cf 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -39,6 +39,15 @@ return YES; } +-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { + [self parseNotificationPayload:userInfo]; + if (application.applicationState == UIApplicationStateActive) { + UIStoryboard *main = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; + [main instantiateInitialViewController]; + } + completionHandler(UIBackgroundFetchResultNewData); +} + - (void)registerForRemoteNotifications { UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; -- cgit v1.2.3