summaryrefslogtreecommitdiff
path: root/Juick/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r--Juick/AppDelegate.m9
1 files changed, 9 insertions, 0 deletions
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;