描述你的問題
我在雲端推送一條訊息,有兩台設備,iOS9.2和iOS7.3,9.2收到5條重複數據,7.3正常收到一條數據,這讓我非常困惑,有大神能指點下嗎。
貼上相關程式碼
註冊推播程式碼如下:
—— (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 注册推送
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
} else {
UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
[application registerForRemoteNotificationTypes:myTypes];
}
}
返回確認不成功吧。然而客戶端應該檢查合併通知的id呀