question

Dale Strickler avatar image
Dale Strickler asked

Difference between "public static class PlayFabClientAPI" and "public class PlayFabClientInstanceAPI : IPlayFabInstanceApi"

Looking at https://github.com/PlayFab/UnitySDK it seems the whole "instance" version of the API was added May 18, 2020.

I just noticed that new API as I was updating a project.

I have looked for a good blog post or something that talks about its introduction and its use. So far I have not found anything. The #200518 release notes don't even seem to mention the addition of a whole new interface class. Am I missing something obvious?

Looking at the API calls in the SDK code it seems like a lot of the calls are more or less identical between the two classes. Other seem. more ... self-contained(?) as full objects rather than just RESTful calls.

I would love a good high-level explanation of the difference. And any guidance about which should be focused on going forward. And under what conditions I should consider switching when updating legacy 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.

1 Answer

·
Ivan Cai avatar image
Ivan Cai answered

When you use the static client API, it is likely to conflict with the instance of the running function at runtime, which will lead to unexpected competition and conditional behavior. If you use the client instance API, you can avoid this situation. If you want to know more detailed information, please refer to Instance APIs

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.

Dale Strickler avatar image Dale Strickler commented ·

Perfect. That reference explains what I was looking for. Thanks!

0 Likes 0 ·

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.