I added this script to my CloudScript:
handlers.getCurrentTime = function () { var now = new Date(); return now.getTime() / 1000; }
I tested a sample request to my function in this page
https://api.playfab.com/Documentation/Client/method/ExecuteCloudScript
And the API Call results prints everything just fine. But when I call the function on my game I get this in return:
{"FunctionName":"getCurrentTime","Revision":5,"FunctionResult":null,"Logs":[],"ExecutionTimeSeconds":9.21E-05,"MemoryConsumedBytes":1168,"APIRequestsIssued":0,"HttpRequestsIssued":0,"Error":null,"Request":{"FunctionName":"getCurrentTime","FunctionParameter":null,"RevisionSelection":null,"SpecificRevision":null,"GeneratePlayStreamEvent":true},"CustomData":null}
I don't know why the FunctionResult is null :S Here is the function I'm calling:
public void StartCloudGetCurrentTime() { ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest() { FunctionName = "getCurrentTime", GeneratePlayStreamEvent = true, }; PlayFabClientAPI.ExecuteCloudScript(request, OnCloudGetCurrentTime, OnErrorShared); }
Thanks for your time :D