question

andrew@spryfox.com avatar image
andrew@spryfox.com asked

No callbacks from LoginWithAndroidDeviceID?

I'm setting up frictionless login and hitting some snags on Android.

In editor, using SystemInfo.deviceUniqueIdentifier as the custom ID, I can create an account and log in. I get a successful callback to resultCallback, and can see my user on the playfab dashboard.

On Android, the same code using LoginWithAndroidDeviceID will show my user being created on the playfab dashboard, but I do not receive resultCallback or even anything to errorCallback.

I see no errors in logcat. I tried turning on logging with `PlayFabSettings.LogLevel = PlayFabLogLevel.All` but that didn't seem to add anything at all. I tried changing from deviceUniqueIdentifier to getting the Android ID directly, and it had no effect.

We're using unity SDK 2.36.180123 on Unity 2017.2.1.

What's going on here? Has anyone seen this before? Is there any more information I can give you?

Account ManagementAuthenticationandroid
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andrew@spryfox.com avatar image andrew@spryfox.com commented ·

More info: even after the dashboard shows the login, PlayFabClientAPI.IsClientLoggedIn() seems to stay false

0 Likes 0 ·
andrew@spryfox.com avatar image
andrew@spryfox.com answered

tldr: my edit-time scene had a PlayFabHTTP object in it. Deleting that fixed everything.

With help from Brendan, I did some more debugging and noticed the request's WWW was starting but not resolving. Which explains why the servers received the login event but I never got a callback. I saw it uses the PlayFabHTTP singleton to run the coroutine, and also that it had code to create it at runtime if it was missing. I don't recall adding one to my scene but it was there in edit mode, so I deleted it and everything started working.

Since my frictionless logins were in my Awake, maybe there was an initialisation order conflict? That would explain why my later username/password logins work fine. I wonder if the SDK can detect this situation and warn of it?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

esk avatar image esk commented ·

Thank you say much for this, it was my exact problem.

Crazy it's still happening in 2024, you'd think Microsoft engineers would be qualified to do their job.

What a horrific bug that could have ruined my life if it weren't for our lord and saviour the person who wrote this comment.

Jeez.

0 Likes 0 ·
brendan avatar image
brendan answered

First, I'd try updating to the latest SDK, just in case. The IsClientLoggedIn call simply checks if you have a Session Ticket - nothing fancy. So it sounds like you're simply not hearing the response from the service, for some reason. Which would explain why neither callback is firing. Have you checked to see if the account was created or not? What Title ID is this for?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andrew@spryfox.com avatar image andrew@spryfox.com commented ·

Like I said, the playfab dashboard shows the account being created and logged in. The title ID is 80CD (I'm assuming that's safe in a public forum if you're asking for it?). I upgraded to 2.39.180409 with no change - no errors, no callbacks. Also tried the same thing with iOS frictionless login and it doesn't work either. We have a username/password login which works perfectly.

0 Likes 0 ·
brendan avatar image brendan andrew@spryfox.com commented ·

Yes, there's nothing secret about a Title ID. The game itself sends it with every call, so it's easily visible. Since that login call is widely used by many games and we've had no other reports of this, I have to assume it's specific to your project or test environment, somehow. The fact that you're not hearing the response at all, when it's clearly reaching the service is what we need to figure out. Can you get a Fiddler or Wireshark capture of this? Have you tried running the test on another machine - and in particular, at a different location?

0 Likes 0 ·
Mikhail Shagin avatar image
Mikhail Shagin answered

I had the same issue. Transferring my login code from Awake to Start helped to me.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Damien Yvray avatar image
Damien Yvray answered

Hi there.I am having the same issue, but I don't really understand how you fixed it. I would love having some help.

I tried transferring the code from awake to start, I tried all the different request types, nothing seems to work.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mohamed Younes avatar image
Mohamed Younes answered

The fix for me was: From project settings=>code strip level => low or turn off. strip level hight causes this issue too.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.