I am sending a list of strings from Azure to Unity but cannot receive it. If I use cast type it won't work how can I convert the result to a list?
If I put result.FunctionResult in a debug I see only one of the strings that are inside
I am sending a list of strings from Azure to Unity but cannot receive it. If I use cast type it won't work how can I convert the result to a list?
If I put result.FunctionResult in a debug I see only one of the strings that are inside
I think you mean how to return a list of strings from an Azure Function to the caller(Unity). If you cannot see the expected content in the function result, please re-check your Azure Function to see if the original content is correct. As for result handling, Unity SDK uses SimpleJson to parse JSON. If AF returns a list, SimpleJson will parse it into JsonArray by default, you can refer to the code below.
What I return in Azure Function:
var ret = new List<string>();
ret.Add("V1");
ret.Add("V2");
ret.Add("V3");
return ret;
Handling in Unity:
var list = result.FunctionResult as PlayFab.Json.JsonArray;
foreach (var item in list)
{
Debug.Log(item);
}
31 People are following this question.