Not able to fetch additional info of other players

0 votes

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

closed with the note: Closing this thread as there was no update from last 2 Weeks or more. Please raise a new query if problem persists.
asked Oct 24, 2014 in App42 Cloud API-BaaS by dhingra.viral2511 (10 points)
closed Nov 10, 2014 by sushil
Could you please share your app credentials along with collection name in which you have save the user information with us at support@shephertz.com? It will helps us to resolve your query on ASAP. Also if possible than share your project source code with us.
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
...