HTTP error while editing user score

0 votes

Hi!

I have the scoreboard service set up on an iOS app.

My app saves the new score only if it's smaller than the previous (it's a time based game, smaller score = better).
The problem is I don't need the previous score anymore, and the scoreboard would be a lot cleaner if there was 1 record/user instead of 50 records/user.
I'm trying to achieve this by checking if the user has a previous score and then editing that instead of adding new record every time. But whenever I use the editScoreValueById:gameScoremethod, I get the following error (the strResponse property):

 

<html><head><title>Apache Tomcat/6.0.35 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 405 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.35</h3></body></html>

 

What might be going on? Is there a better way to do this?

P.S.
Is it possible to get the lowest scores for a game? Like with the 
getTopNRankers:max: method but in reverse mode?

 
asked Mar 29, 2014 in App42 Cloud API-BaaS by ootsamo (15 points)

1 Answer

0 votes
 
Best answer

Hi,

We have fixed the issue. You can download the latest App42SDK from our github repo.

Thanks.

answered Mar 29, 2014 by rajeev.etc (1,660 points)
selected Mar 29, 2014 by ootsamo
Cool, thank you!
Well, sort of cool. The getUserByEmailId method stopped working. Throws an App42Exception every time.

Terminating app due to uncaught exception 'App42Exception', reason: ''
You should always call APIs inside try-catch block as follows:
 @try
    {
        NSString *email = @"example@email.com";
        
        User *user = [userServiceObject getUserByEmailId:email];
        
        NSLog(@"User Name=%@",user.userName);
        NSLog(@"Email = %@",user.email);
        NSLog(@"SessionId = %@",user.sessionId);
        
    }
    @catch (App42Exception *exception)
    {
        NSLog(@"Exception = %@",[exception reason]);
        NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
        NSLog(@"App Error Code = %d",[exception appErrorCode]);
        NSLog(@"User Info = %@",[exception userInfo]);
    }
    @finally
    {
        
    }

App42 SDK throws exceptions in case of wrong parameter like null, empty or no internet connection or the user with this email id does not exist.

Hope it will help.

Thanks.
It's working now... Don't know what caused it to crash previously though.
Anyways good to know the try-catch thing.
Thanks a lot for your help!
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
...