From 2e9ebfa5e1962ede330250cf19bd820344ed14ed Mon Sep 17 00:00:00 2001 From: kevinzhow Date: Sat, 24 Oct 2015 18:50:13 +0800 Subject: [PATCH] Better completetion --- Yep/AppDelegate.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Yep/AppDelegate.swift b/Yep/AppDelegate.swift index ea06bf90..3afe0a39 100644 --- a/Yep/AppDelegate.swift +++ b/Yep/AppDelegate.swift @@ -219,7 +219,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return } syncUnreadMessages() { - completionHandler(UIBackgroundFetchResult.NewData) APService.handleRemoteNotification(userInfo) } @@ -227,7 +226,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { officialMessages { messagesCount in println("new officialMessages count: \(messagesCount)") - completionHandler(UIBackgroundFetchResult.NewData) APService.handleRemoteNotification(userInfo) } @@ -235,13 +233,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { if let subType = userInfo["subtype"] as? String { if subType == "accepted" { syncFriendshipsAndDoFurtherAction { - completionHandler(UIBackgroundFetchResult.NewData) APService.handleRemoteNotification(userInfo) } } } } + completionHandler(UIBackgroundFetchResult.NewData) // 非前台才记录启动通知类型 if application.applicationState != .Active { self.remoteNotificationType = remoteNotificationType