當應用程序在後臺時間徽章計數沒有設置最後5天前正常工作。
徽章計數每次增加php後端ex。當前徽章= 10然後第二次推後得到然後徽章= 11ios:推送通知徽章數不增加在這個有效載荷合成
我正在使用波紋管有效載荷甲酸鹽。
如果波紋管甲的任何變化,然後幫助我,我看也指Apple Push Notification Service.
推送通知的有效載荷是JSON有效載荷:
{
"aps": {
"badge": 10,
"alert": "Hello world!",
"sound": "cat.caf"
}
}
registerUserNotificationSettings
if (ios8)
{
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
看起來很好,你是否通過Pusher檢查過? – techloverr
你可以更具體地說明你的問題:你是否將魔杖設置爲10或者是否要增加10?混淆你的問題的標題。 –
你確定使用適當的'UIUserNotificationType.Badge'來調用'registerUserNotificationSettings'嗎? – dbn