我连续向 APNS 发送 10 条消息。当应用程序处于后台时,我会收到所有消息。但是当应用程序在前台时,我会收到 8 条通知。
这里有什么问题?
这是我的代码,非常简单:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSLog(@"Test push...");
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeNone)];
[self checkForRegisteredUser];
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
return YES;
}