0
推送通知在應用程序處於後臺時不會收到。如果應用程序處於前臺,則它正常工作,如果後臺的應用程序在收到通知後需要啓動某個進程。推送通知在應用程序處於後臺時不會收到使用解析
這裏我的代碼是:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
if (application.applicationState == UIApplicationStateInactive)
{
NSLog(@" background userInfo =%@",userInfo);
[PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo];
}
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
NSLog(@"%@",userInfo);
}
我的環境:iOS8,Xcode 6.3,Mac10.10.