question

carlo.rodriguez08@gmail.com avatar image
carlo.rodriguez08@gmail.com asked

Why is PlayFabData not included in latest Unity SDK package?

Previously, I would use PlayFabData and PlayFabClientAPI to access AuthKey in order to do checks of whether or not the user was logged in. However, since I haven't updated PlayFab in a while, I decided to download the latest package, but noticed that it does not include PlayFabData class and PlayFabClientAPI class has a variable for authkey, but it is private instead of public. Were these changes intentional or should I continue using the older version of PlayFabClientAPI and keep PlayFabData in my project?

10 |1200

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

brendan avatar image
brendan answered

The PlayFabData helper class was removed quite some time ago, due to two problems:

1. It wasn't compatible with all devices. In particular, there were problems writing to it on Android devices.

2. It caused a problem in the Inspector, due to the binary stream it kept open.

We'll be adding more client-side functionality in the future, including caching, at which point we'll be providing a helper for this.

10 |1200

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

Hamza Lazaar avatar image
Hamza Lazaar answered

Hi Carlo Rodriguez,

This was changed a while ago. At least I noticed it a few weeks back.

Anyway, you should find what you're looking for in PlayFabSettings class IIRC.

10 |1200

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

carlo.rodriguez08@gmail.com avatar image
carlo.rodriguez08@gmail.com answered

It only seems to have TitleId. I don't see anything for AuthKey, and should I change the authkey in PlayFabClientAPI class to public?

10 |1200

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

Hamza Lazaar avatar image
Hamza Lazaar answered

After checking my code I remembered that I had to start handling this on my own since. You should save/cache the AuthKey by yourself and use it to check if player is signed in or not. But the tricky part is the edge cases of token expiration. You should maybe save timestamp also.

10 |1200

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

carlo.rodriguez08@gmail.com avatar image
carlo.rodriguez08@gmail.com answered

Hm, okay. Do you know the reason why PlayFabData is not used anymore along with the public variable of AuthKey in PlayFabClientAPI though? It seemed to be working fine for me at the time.

 

Thanks for your help by the way.

10 |1200

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

Hamza Lazaar avatar image
Hamza Lazaar answered

Honestly I don't know and I find your question legitimate. We should wait for Brendan to show up. 

10 |1200

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

smkays92@gmail.com avatar image
smkays92@gmail.com answered

Hi, I'm having the same problem here, I just update my project to the newest playfab and  it does not contain PlayFabData.AuthKey, and I've used a lot inside my prev games

10 |1200

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

brendan avatar image
brendan answered

Please see above. PlayFabData was removed due to compatibility issues.

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.