Search code examples
apple-push-notificationsbadgequickblox

Quickblox Simple iOS Push Badge Increment


Hi I'm using quickblox in one of my iOS apps and so far everything has been great and easy to use, however, I've seem to have hit a wall. I'm trying to increment my applications badge count for when I receive new push notifications from quickblox but I can't seem to figure out how I should pass the count from simple push in the iOS simple push api.

I also would like to pass a variable to tell my app where to open to once a push notification is received any help with how I can do this using quickblox would be greatly appreciated


Solution

  • You have to use this code sample to manage badge counter and other values

    NSString *mesage = @"This is push";
    
    NSMutableDictionary *payload = [NSMutableDictionary dictionary];
    NSMutableDictionary *aps = [NSMutableDictionary dictionary];
    [aps setObject:@"default" forKey:QBMPushMessageSoundKey];
    [aps setObject:mesage forKey:QBMPushMessageAlertKey];
    [aps setObject:@"5" forKey:QBMPushMessageBadgeKey];
    [payload setObject:aps forKey:QBMPushMessageApsKey];
    
    QBMPushMessage *message = [[QBMPushMessage alloc] initWithPayload:payload];
    
    [QBMessages TSendPush:message toUsers:@"45288,300" delegate:self];