Error 1400 on Logout

0 votes

When I try to Logout the user I always get back error code 1400 Request Parameters are Invalid.

I am doing this to log out:

App42.Instance.userService.Logout(App42.Instance.user.GetSessionId(), new LogOutCallBack());

App42.Instance is just a singleton I have for managing the App42 services and user.  Using Debug.Log I can verify that App42.Instance.user.GetSessionId() returns the proper sessionId string.  And userService is set to App42API.BuildUserService();

After I try to log the user out of App42 I also set my user object to null, and set the userName and sessionId to empty strings in Player Prefs, so functionally within my game it appears to work fine from a user perspective; in the game the user seems to log out and I am able to successfully log in another player with App42.  But it bothers me that the logout method is returning an error message.  What should I do?

asked Apr 10, 2014 in App42 Cloud API-BaaS by Rhinosaurus (32 points)

1 Answer

+1 vote
 
Best answer

Make sure have you correctly Initialized with App42

App42API.Initialize("API_KEY","SECRET_KEY");  

answered Apr 10, 2014 by sshukla480 (407 points)
selected Apr 10, 2014 by Rhinosaurus
I checked that and it seems OK.  Also, everything else I do works; login with a different user, get buddys, get buddy requests, accept a buddy request, reject a buddy request etc.  All those things are working and I think if there was a problem initializing with App42 that none of those would work either.

After refactoring the code it works now.  I had a few different instances of userService, but consolidated them into one instance within the singleton.  I think it may have been the instance of UserService I created with BuildUserService for my Logout page was being called before I had correctly initialized with App42, but the other versions were called after that, which is why they worked.

Thank you very much for helping me troubleshoot this issue.
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
...