question

pinkencryption avatar image
pinkencryption asked

Can not use LoginWithCustomIDAsync with Unity 2018

Hi,

Installed the official playfab SDK and I can not find this method. No async methods are available.

What is the solution? Are these available playfaballSDK, how to make that one work with Unity 2018 and .net 4.6.

We are looking forward to use async requests with Unity.

Thank You

apisunity3d
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

·
JayZuo avatar image
JayZuo answered

In PlayFab Unity SDK, it doesn't use C# async/await features as it's not supported in Unity's legacy scripting runtime (.NET 2.0 Subset and .NET 2.0) and there are a lot of projects use the legacy scripting runtime. So no async methods are exposed in the official PlayFab Unity SDK.

Instead, the Unity SDK uses a callback pattern. For each API call, you can always find a resultCallback and a errorCallback. Within these callbacks you can handle any logic you want. Although these APIs are not end with "Async", but they are just using another asynchronous pattern and are compatible with Unity 2018 and .Net 4.6, you can still use this pattern to perform async requests.

If you insist on using async/await pattern, then you can try with the CSharpSDK.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]