I got this error "Cannot connect to destination host" while calling PlayFabCloudScriptAPI.ExecuteFunction in Unity.
Here's my code:
PlayFabCloudScriptAPI.ExecuteFunction(new ExecuteFunctionRequest() { Entity = new EntityKey() { Id = PlayFabSettings.staticPlayer.EntityId, //Get this from when you logged in, Type = PlayFabSettings.staticPlayer.EntityType, //Get this from when you logged in }, FunctionName = functionName, //This should be the name of your Azure Function that you created. FunctionParameter = parameters, //This is the data that you would want to pass into your function. GeneratePlayStreamEvent = false //Set this to true if you would like this call to show up in PlayStream }, (result) => { if (result.FunctionResultTooLarge ?? false) { Debug.Log("This can happen if you exceed the limit that can be returned from an Azure Function, See PlayFab Limits Page for details."); return; } Utility.Logger.Log($"The {result.FunctionName} function took {result.ExecutionTimeMilliseconds} to complete"); Utility.Logger.Log($"Result: {result.FunctionResult.ToString()}"); }, (error) => { Debug.LogError( $"Opps Something went wrong when calling cloudscript {functionName}: {error.GenerateErrorReport()}"); });
What I have checked:
- I don't think it's the network issue because I am able to successfully get title data using PlayFabClientAPI.GetTitleData
- TitleID has been correctly set using PlayFab's unity editor extension
I would appreciate for some help. I have been on this issue all day.