Search code examples
iossdkquickblox

Quickblox: how to access custom object special parameters (increment) in iOS SDK?


Is it possible to access special parameters defined in http://quickblox.com/developers/Custom_Objects#Special_update_operators via Quickblox iOS SDK?

E.g. updating a custom object record by incrementing (or decrementing) specific numerical field?

What I would like to do in my application to increment couple of fields by +1.


Solution

  • I have test CO with integer field "value". At first I set value to 20.

    NSMutableDictionary *updateRequest = [NSMutableDictionary new];
    [dictionary setObject:@(1500) forKey:@"inc[value]"];
    
    [QBCustomObjects updateObject:obj specialUpdateOperators:updateOperators delegate:self];
    

    Now I have object with value = 1520.

    Be careful with permissions. If you don't right setup it, you'll get "Wrong permission" error