• Sign Up Login
  • Features
    • Game Services
    • Real-time Analytics
    • LiveOps
    • Add-ons
  • Game Services
  • Real-time Analytics
  • LiveOps
  • Add-ons
  • Games
  • Pricing
  • Blog
  • Support
    • Docs
    • Forums
    • Contact
  • Docs
  • Forums
  • Contact
  • Sign Up Login
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by studio · Dec 19, 2017 at 02:48 PM · unity3dandroid

Error when get results back

Hi All ,

I got a funny issue, I move all my backend code into the DLL and all has been working great, but today I can no longer get the success response back from the server. It works fine in the editor, and on my android, i get the error msgs but not success msgs.

I have upgraded to the current playfab sdk

here is the request

var requestAndroid = new LoginWithAndroidDeviceIDRequest { AndroidDeviceId = SystemInfo.deviceUniqueIdentifier, AndroidDevice = SystemInfo.deviceModel, OS = SystemInfo.operatingSystem, CreateAccount = true };

Here is the trace log from unity

AndroidPlayer(ADB@127.0.0.1:34999) NullReferenceException: Object reference not set to an instance of an object at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0 at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <filename unknown>:0 at PlayFab.Json.PlayFabSimpleJson.DeserializeObject (System.String json, System.Type type, IJsonSerializerStrategy jsonSerializerStrategy) [0x00000] in <filename unknown>:0 at PlayFab.Json.PlayFabSimpleJson.DeserializeObject[HttpResponseObject] (System.String json, IJsonSerializerStrategy jsonSerializerStrategy) [0x00000] in <filename unknown>:0 at PlayFab.Json.SimpleJsonInstance.DeserializeObject[HttpResponseObject] (System.String json) [0x00000] in <filename unknown>:0 at PlayFab.Json.JsonWrapper.DeserializeObject[HttpResponseObject] (System.String json) [0x00000] in <filename unknown>:0 at PlayFab.Internal.PlayFabWww+<>c__DisplayClass12_0.<MakeApiCall>b__0 (System.String response) [0x00000] in <filename unknown>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) PlayFab.Internal.<>c__DisplayClass12_0:<MakeApiCall>b__0(String) PlayFab.Internal.<Post>d__13:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) (Filename: Line: -1)
Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image studio · Dec 19, 2017 at 04:09 PM 0
Share

So i added some debug to the code , to see if I can see the error

here is the response string I get before the error

AndroidPlayer(ADB@127.0.0.1:34999)

{"code":200,"status":"OK","data":{"SessionTicket":"55848E2905116D24---E5C-8D546FA1A72B58C-EzUkY7wkADC+j9J0L+CO0GvexRL4oH8H8kGtKDQUIM0=","PlayFabId":"55848E2905116D24","NewlyCreated":false,"SettingsForUser":{"NeedsAttribution":false,"GatherDeviceInfo":false},"LastLoginTime":"2017-12-19T15:51:00.189Z"}}

any one got any ideas

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by studio · Dec 19, 2017 at 05:44 PM

So I got it working by changing the code to

HttpResponseObject httpResult = new HttpResponseObject();
httpResult = JsonWrapper.DeserializeObject<HttpResponseObject>(response);

Comment

People who like this

0 Show 8 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Brendan ♦♦ · Dec 20, 2017 at 02:18 AM 0
Share

You do need to deserialize the body of the response from the service, but our SDK normally takes care of that for you. Can you provide the code snippet showing how you were making the call and processing the response before you added this deserialize call?

avatar image studio Brendan ♦♦ · Jan 04, 2018 at 01:50 PM 0
Share

Hi Brendan ,

Here is the code that using

 var request = new LoginWithCustomIDRequest { CustomId = SystemInfo.deviceUniqueIdentifier, CreateAccount = true };


                    PlayFabClientAPI.LoginWithCustomID(request, (result) =>
                    {
                        CompleteUserLogon(result);
                    }, (error) =>
                     {
                         if (FailedLogon != null) FailedLogon((int)error.Error);
                         BAASErrorHandler(error);
                     });

Let me know if you need anything more

avatar image Brendan ♦♦ studio · Jan 04, 2018 at 05:53 PM 0
Share

So are you saying that at that stage - CompleteUserLogon, you were not able to use the result as shown in the samples? What would result.PlayFabId or result.SessionTicket return? If you weren't able to use those, what SDK and what version of it are you using?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Android Plugin Upgrade Discussion 4 Answers

    Google Play Games: Silent Login 1 Answer

    Getting started with Push Notifications and Unity and PlayFab. 1 Answer

    OAuth consent screen and Playfab: Can't verify because I don't own playfab.com domain 1 Answer

    linking issue android, FB. 0 Answers

    • PlayFab

      • Features
      • Games
      • Pricing
      • Blog
    • Engineers

      • Documentation
      • Quickstarts
      • API Reference
      • SDKs
      • Usage Limits
    • Support

      • Forums
      • Videos
      • Contact
      • Service Health
      • Terms of Service
    • Social

      • Facebook
      • Twitter
      • LinkedIn
      • YouTube
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • About Microsoft
    • Jobs
    • Accessibility
    • Diversity & inclusion
    • Security
    • Company news
    • © Microsoft 2019
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges