我遇到警告问题:
此方法来自官方文档,因此我不了解它(或实现)的错误
答案 0 :(得分:0)
试试这段代码:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
if application.applicationState == .Inactive || application.applicationState == .Background {
self.sendGoogleAnalyticsEventWithInfo(userInfo)
}
}