Updating Json added as custom score

0 votes

Hi,

 

I am using App42 API to save User Score on Server.

I uploaded the custom score on the server using code...

 

NSString *userName = @"Name";

double gameScore = 100;

NSString *collectionName = @"Colection Name";

NSDictionary *otherScoreInfo = [NSDictionary dictionaryWithObjectsAndKeys:playerId,@"id",playerlevel,@"playerLevel"nil];

[App42API setDbName:@"DBName"];

ScoreBoardService *scoreboardService = [App42API buildScoreBoardService];

@try {

    [scoreboardService addCustomScore:otherScoreInfo collectionName:collectionName];

}

@catch (NSException *exception) {

    NSLog(@"Exception");

    NSLog(@"AddCustom Score");

}

@try {

    Game *game = [scoreboardService saveUserScore:@"Game name"  gameUserName:userName gameScore:gameScore];   

    NSLog(@"Game  : %@",game);

}

 

 

Can somebody help me with the code sample to update the json attached to score.

I am able to update the score but not the json associated with it.All i want is to update the Json file attached to score and not to create a new json.

 

Thanks

 

asked Feb 3, 2015 in App42 Cloud API-BaaS by viral.dhingra2511 (10 points)

1 Answer

0 votes

Hello Viral,

The code snippet which you have shared is only for adding the new json document along with Save score method. If you need to update the json document, you need to call AddOrUpdateKeys method or UpdateDoument method from storage service.

Please have a look at this link for the code  snippet & let us know if it helps.

Thanks,

Himanshu Sharma

 

answered Feb 4, 2015 by hs00105 (2,005 points)
Thanks for a quick response. :)
Hello Viral,

Let us know if you need further assistance regarding this.

Thanks,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...