2015-05-22 104 views

回答

0

試試這個代碼:

func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) { 
     if application.applicationState == .Inactive || application.applicationState == .Background { 
      self.sendGoogleAnalyticsEventWithInfo(userInfo) 
     } 
    } 
+0

在第二行靜止警告(如果application.applicationState == .Inactive || application.applicationState ==裝置技術領域{) – Maria

+0

你能告訴我你的迅捷版嗎? 對我來說,這個作品完美 – Maybe1

+0

1.2。和Xcode 6.3.2 – Maria