I have shared code to invoke the PlayFab API from either a Windows standalone app or a Unity app, and in both cases I'd like the call to be asynchronous. Below is an example method wrapping PlayFabEntityAPI.GetFiles. I took a break for a few months from working on this project, and this worked previously, but it throws a build error when I try to run the app in Unity now.
The error message seems to indicate that the WWW constructor (invoked in PlayFabWWW.cs, line 89) can't be called from a thread that's not Main, but I swear this used to work. Calling the PlayFab API from an async method in Unity has been great; I would not like to find another pattern to invoke PlayFab.
Here's the build error I'm seeing now
Create can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. UnityEngine.WWW:.ctor(String, Byte[], Dictionary`2) PlayFab.Internal.PlayFabWww:MakeApiCall(CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:89) PlayFab.Internal.PlayFabHttp:MakeApiCall(String, PlayFabRequestCommon, AuthType, Action`1, Action`1, Object, Dictionary`2, Boolean) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:249) PlayFab.PlayFabEntityAPI:GetFiles(GetFilesRequest, Action`1, Action`1, Object, Dictionary`2) (at Assets/PlayFabSdk/Entity/PlayFabEntityAPI.cs:179) LizardBreath.<GetFileAsync>c__async4:MoveNext() (at Assets/_Core/dnd5e/Storage/PlayFab/PlayFabAsync.cs:313) System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(<GetFileAsync>c__async4&) LizardBreath.PlayFabAsync:GetFileAsync(EntityKey)