我們使用Pushwhoosh遠程通知。它的工作正常,但圖標徽章計數沒有增加。Pushwhoosh遠程通知
這裏是代碼:
- (void) onPushReceived:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart
{
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge)];
PushNotificationManager * pushManager = [PushNotificationManager pushManager];
pushManager.delegate = self;
if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
PushNotificationManager * pushManager = [PushNotificationManager pushManager];
[pushManager startLocationTracking];
}
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}
如何提高應用程序圖標徽章在推送算什麼?
沒有得到它。你的意思是我們需要做一些推動whoosh服務器端通知消息?我將它設置在onPushReceived中,所以它沒有效果? – Guru 2014-09-30 11:15:59
我的意思是,當應用程序被關閉或背景,我們在onPushReceived設定值不會起作用,因爲該方法不會invoked.The值被通告的負載設定。 – 2014-09-30 11:20:37
通知負載意味着從推送whoosh服務器發送的消息。所以我們需要聯繫推送whoosh服務器。在此之前, – Guru 2014-09-30 11:21:48