Session Logout

0 votes

HI AppWarp Team,

 
We've used your sdk in one of my multiplayer game. My app is getting crash each and every time if we try to logout form appwarp . Please check the below lines of code
 

UserService *userService =[[AppWarpHelper appWarpHelper] getUserService];

         NSString *sessionId = playerProfile.userId;

        NSLog(@"the session id is %@",sessionId);

        [userService logout:sessionId completionBlock:^(BOOL success, id responseObj, App42Exception *exception) {

            if (success)

            {

                App42Response *response = (App42Response*)responseObj;

                NSLog(@"Response=%@",response.strResponse);

            }

            else

            {

                NSLog(@"Exception = %@",[exception reason]);

                NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);

                NSLog(@"App Error Code = %d",[exception appErrorCode]);

                NSLog(@"User Info = %@",[exception userInfo]);  

            }  

        }];

 

Crash report:

*** -[CFString isEqualToString:]: message sent to deallocated instance 0x7fdf35deee90

Thanks & Regards,

Vara Prasad.

 

asked Feb 5, 2015 in AppWarp by ydvvaraprasad473 (10 points)

1 Answer

0 votes

Hi Vara,

Can you please try updating your SDK with the latest version from our github repo

If you are getting the issue with the latest version also then copy the SDK internal logs from xcode console and send to us.

To enable SDK internal logs, place this code just before calling logout API:

[App42API enableApp42Trace:YES];

It will help us find the problem easily.

Thanks.

answered Feb 5, 2015 by rajeev.etc (1,660 points)
Thanks for your reply. After updating sdk crash problem is solved. I enabled tracing before calling logout function as you said. I got below log
2015-02-05 14:25:52.649 Puzzle Dash[2428:74975] the session id is 95daec2e-f8d7-44b1-9f37-9c86d3bfe415
App42Trace: -[App42Service populateSignParams].....IN
App42Trace: UTCTimeStamp=2015-02-05T08:55:52.658Z
App42Trace: -[App42Service populateSignParams].....OUT
App42Trace: -[App42Service populateMetaHeaderParams].....IN
App42Trace: InstallationId=46a809bf124fe7b69623e5062a3cb533
App42Trace: -[App42Service populateMetaHeaderParams].....OUT
App42Trace: MetaHeaders={
  "SDKName" : "iOS",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533",
  "emailAuth" : "true",
  "loggedInUser" : "vara"
}
App42Trace: urlString=https://api.shephertz.com/cloud/1.0/session?
App42Trace: headerParams={
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533",
  "SDKName" : "iOS",
  "timeStamp" : "2015-02-05T08:55:52.658Z",
  "sessionId" : "95daec2e-f8d7-44b1-9f37-9c86d3bfe415",
  "version" : "1.0",
  "emailAuth" : "true",
  "loggedInUser" : "vara",
  "signature" : "Xu8R7iFZMLpbY%2Fw7f5SRd8tKerw%3D"
}
App42Trace: queryParams={

}
2015-02-05 14:25:53.024 Puzzle Dash[2428:75075] Block Executed
App42Trace: Response STring={"app42":{"response":{"success":true,"session":{"userName":"vara","sessionId":"95daec2e-f8d7-44b1-9f37-9c86d3bfe415","createdOn":"2015-02-05T08:54:22.000Z","invalidatedOn":"2015-02-05T08:55:53.000Z"}}}}
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseString={"app42":{"response":{"success":true,"session":{"userName":"vara","sessionId":"95daec2e-f8d7-44b1-9f37-9c86d3bfe415","createdOn":"2015-02-05T08:54:22.000Z","invalidatedOn":"2015-02-05T08:55:53.000Z"}}}}
2015-02-05 14:25:53.036 Puzzle Dash[2428:74975] +[App42API setLoggedInUser:]
2015-02-05 14:25:53.070 Puzzle Dash[2428:74975] Response={"app42":{"response":{"success":true,"session":{"userName":"vara","sessionId":"95daec2e-f8d7-44b1-9f37-9c86d3bfe415","createdOn":"2015-02-05T08:54:22.000Z","invalidatedOn":"2015-02-05T08:55:53.000Z"}}}}
App42Trace: -[EventService getLoggedInUserProperties:]
2015-02-05 14:25:53.073 Puzzle Dash[2428:75175] app42RequestCounter=1...counter=1
2015-02-05 14:25:53.074 Puzzle Dash[2428:75175] app42RequestCounter=2..
App42Trace: -[App42Service populateSignParams].....IN
App42Trace: UTCTimeStamp=2015-02-05T08:55:53.080Z
App42Trace: -[App42Service populateSignParams].....OUT
App42Trace: -[App42Service populateMetaHeaderParams].....IN
App42Trace: InstallationId=46a809bf124fe7b69623e5062a3cb533
App42Trace: -[App42Service populateMetaHeaderParams].....OUT
App42Trace: MetaHeaders={
  "SDKName" : "iOS",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533"
}
App42Trace: -[EventService getValueFromEventObjectForKey:]
App42Trace: SignParams = {
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "timeStamp" : "2015-02-05T08:55:53.080Z",
  "body" : "{\"app42\":{\"event\":{\"installProperties\":\"\",\"app42_installAt\":\"2015-02-05T08:55:47.890Z\"}}}",
  "version" : "1.0"
}
App42Trace: urlString=https://analytics.shephertz.com/cloud/1.0/event/userproperties?
App42Trace: headerParams={
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "timeStamp" : "2015-02-05T08:55:53.080Z",
  "SDKName" : "iOS",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533",
  "signature" : "uZUeu93kmhEM61buRJJw91cz5lc%3D",
  "version" : "1.0"
}
App42Trace: queryParams={

}
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseDict={
  "app42Fault" : {
    "message" : "Bad Request",
    "appErrorCode" : 1402,
    "details" : "The resource that is being accessed is disabled",
    "httpErrorCode" : 400
  }
}
2015-02-05 14:25:53.469 Puzzle Dash[2428:74975] Is Install Event Success = 0

it's logged out from the current section and I'm trying to sign in again this time it's not succeeded I got below log

2015-02-05 14:29:29.184 Puzzle Dash[2428:74975] Reachability Flag Status: -R -----l- networkStatusForFlags
App42Trace: -[App42Service populateSignParams].....IN
App42Trace: UTCTimeStamp=2015-02-05T08:59:31.506Z
App42Trace: -[App42Service populateSignParams].....OUT
App42Trace: -[App42Service populateMetaHeaderParams].....IN
App42Trace: InstallationId=46a809bf124fe7b69623e5062a3cb533
App42Trace: -[App42Service populateMetaHeaderParams].....OUT
App42Trace: MetaHeaders={
  "SDKName" : "iOS",
  "emailAuth" : "true",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533"
}
App42Trace: urlString=https://api.shephertz.com/cloud/1.0/user/authenticate?
App42Trace: headerParams={
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533",
  "SDKName" : "iOS",
  "timeStamp" : "2015-02-05T08:59:31.506Z",
  "signature" : "VzbrkBfX11N6X5cfmOZIPPX3irA%3D",
  "version" : "1.0",
  "emailAuth" : "true"
}
App42Trace: queryParams={

}
App42Trace: Response STring={"app42":{"response":{"success":true,"users":{"user":{"userName":"vara","accountLocked":false,"sessionId":"b09521cb-af99-4d36-a831-1062f5e1ac4a","email":"vara@gmail.com"}}}}}
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseString={"app42":{"response":{"success":true,"users":{"user":{"userName":"vara","accountLocked":false,"sessionId":"b09521cb-af99-4d36-a831-1062f5e1ac4a","email":"vara@gmail.com"}}}}}
2015-02-05 14:29:32.456 Puzzle Dash[2428:74975] +[App42API setLoggedInUser:]
2015-02-05 14:29:32.464 Puzzle Dash[2428:74975] userName is vara
2015-02-05 14:29:32.464 Puzzle Dash[2428:74975] sessionId is b09521cb-af99-4d36-a831-1062f5e1ac4a
2015-02-05 14:29:32.469 Puzzle Dash[2428:74975] the BAD_REQUEST is called
App42Trace: -[EventService getLoggedInUserProperties:]
2015-02-05 14:29:32.475 Puzzle Dash[2428:75989] app42RequestCounter=2...counter=1
2015-02-05 14:29:32.475 Puzzle Dash[2428:75989] app42RequestCounter=3..
App42Trace: -[App42Service populateSignParams].....IN
App42Trace: UTCTimeStamp=2015-02-05T08:59:32.481Z
App42Trace: -[App42Service populateSignParams].....OUT
App42Trace: -[App42Service populateMetaHeaderParams].....IN
App42Trace: InstallationId=46a809bf124fe7b69623e5062a3cb533
App42Trace: -[App42Service populateMetaHeaderParams].....OUT
App42Trace: MetaHeaders={
  "SDKName" : "iOS",
  "loggedInUser" : "vara",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533"
}
App42Trace: -[EventService getValueFromEventObjectForKey:]
App42Trace: SignParams = {
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "timeStamp" : "2015-02-05T08:59:32.481Z",
  "body" : "{\"app42\":{\"event\":{\"installProperties\":\"\",\"app42_installAt\":\"2015-02-05T08:55:47.890Z\"}}}",
  "sessionId" : "b09521cb-af99-4d36-a831-1062f5e1ac4a",
  "version" : "1.0"
}
App42Trace: urlString=https://analytics.shephertz.com/cloud/1.0/event/userproperties?
App42Trace: headerParams={
  "apiKey" : "278d05d0894415e61ab675a85165059c12c38e76738b9fee797504cb37178e75",
  "deviceId" : "46a809bf124fe7b69623e5062a3cb533",
  "SDKName" : "iOS",
  "timeStamp" : "2015-02-05T08:59:32.481Z",
  "sessionId" : "b09521cb-af99-4d36-a831-1062f5e1ac4a",
  "loggedInUser" : "vara",
  "version" : "1.0",
  "signature" : "vclF5EvYJQ8FkZBE9y9I3r2jn3k%3D"
}
App42Trace: queryParams={

}
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseDict={
  "app42Fault" : {
    "message" : "Bad Request",
    "appErrorCode" : 1402,
    "details" : "The resource that is being accessed is disabled",
    "httpErrorCode" : 400
  }
}
2015-02-05 14:29:33.345 Puzzle Dash[2428:74975] Is Install Event Success = 0
I went through the logs above and found this:
responseString={"app42":{"response":{"success":true,"users":{"user":{"userName":"vara","accountLocked":false,"sessionId":"b09521cb-af99-4d36-a831-1062f5e1ac4a","email":"vara@gmail.com"}}}}}

That means authenticate request is getting success response from server.

Can you please tell us what is the response you are getting in the completionBlock of authenticate API.
hello,
after logout i'm getting the bad request as follows
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseDict={
  "app42Fault" : {
    "message" : "Bad Request",
    "appErrorCode" : 1402,
    "details" : "The resource that is being accessed is disabled",
    "httpErrorCode" : 400
  }
}

while trying to login also i'm getting bad request error
App42Trace: __64-[Connector handleAsyncResponse:withData:error:completionBlock:]_block_invoke..responseDict={
  "app42Fault" : {
    "message" : "Bad Request",
    "appErrorCode" : 1402,
    "details" : "The resource that is being accessed is disabled",
    "httpErrorCode" : 400
  }
Hi Vara,
This part of the log does not belong to authenticate request. This is SDK internal log and will be removed in our next release.
For now you can just comment the code you placed for getting SDK internal logs and check the response in the completionBlock of the authenticate API.
Let us know if the re-login is working.
Thanks.
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
...