I'm trying to call a Azure Functions cloudscript function through the Unity Playfab SDK.
It seems to me at the moment this is only possible with a Client Entity token, and not within the Admin context. My code works when I am in Play mode and the client has logged in.
PlayFabCloudScriptAPI.ExecuteFunction(new ExecuteFunctionRequest() { Entity = new PlayFab.CloudScriptModels.EntityKey() { Id = PlayFabSettings.staticPlayer.EntityId, Type = PlayFabSettings.staticPlayer.EntityType, }, FunctionName = "myFunction", FunctionParameter = new Dictionary<string, object>() { {"player", playfabID}, } }, (ExecuteFunctionResult result) => { Debug.Log(result); }, (PlayFabError error) => { Debug.Log(error.GenerateErrorReport()); });
But I need it to work in Admin context, in editor-mode, for maintenance functions.
This line from PlayFabCloudScriptAPI.cs prevents the function from being called
if (!context.IsEntityLoggedIn()) throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn,"Must be logged in to call this method");
If I comment it out, it tries to execute it but I get the following error:
This API method does not allow anonymous callers.
PS: I've asked a similar question but I can't seem to edit it, or remove it. Sorry for double posting.