I made the changes to fetch the additional data for Other Players but its not working in my case.However, on the console i can see two json docs present in the same Collection.Can you please share a sample code snippet to do this.
Or try it yourself at your end.
I have already asked the same question two times and its really delaying my work.
Also i can call you at your support center to get it resolved.
Please resolve this on priority today so that i may continue with my work.
This is what i tried:
int max = 5;
NSString *dbName = @"DB Name";
NSString *collectionName = @"Collection Name";
[App42API setDbName:dbName];
[_scoreBoardService setQuery:collectionName metaInfoQuery:nil];
//Tried both the methods to fetch top rank players
// Game *game = [_scoreBoardService getTopNRankers@"Game Name" max:max];
Game *game = [_scoreBoardService getTopNRankings:@"Game Name" max:max];
NSLog(@"Game Name=%@",game.name);
NSLog(@"Description =%@",game.description);
for (Score *score in game.scoreList)
{
NSLog(@"UserName=%@",score.userName);
NSLog(@"ScoreId=%@",score.scoreId);
NSLog(@"CreatedOn=%@",score.createdOn);
NSLog(@"Rank=%@",score.rank);
NSLog(@"Score=%f",score.value);
NSLog(@"JsonDoc Array Count : %d",score.jsonDocArray.count);
for (JSONDocument *doc in score.jsonDocArray)
{
NSLog(@"CreatedAt=%@",doc.createdAt);
NSLog(@"UpdatedAt=%@",doc.updatedAt);
NSLog(@"DocId=%@",doc.docId);
NSLog(@"Owner=%@",doc.owner);
NSLog(@"Doc=%@",doc.jsonDoc);
NSData *data = [doc.jsonDoc dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSString *name = [jsonDict objectForKey:@"name"];
NSLog(@"Name : %@", name);
}
}
Previous Questions:
http://forum.shephertz.com/?qa=4079/not-able-to-fetch-additional-info-of-other-players
http://forum.shephertz.com/?qa=4059/get-additional-data-for-users