private static async Task PostTestResultsToCloudScript(TestSuiteReport testReport) { #if !DISABLE_PLAYFABCLIENT_API PfClient.GetSettings().TitleId = TestTitleData.titleId; var loginRequest = new LoginWithCustomIDRequest { CustomId = PlayFabSettings.BuildIdentifier, CreateAccount = true, }; var saveRequest = new ExecuteCloudScriptRequest { FunctionName = "SaveTestData", FunctionParameter = new Dictionary <string, object> { { "customId", PlayFabSettings.BuildIdentifier }, { "testReport", new[] { testReport } } }, GeneratePlayStreamEvent = true }; try { var loginResult = await PfClient.LoginWithCustomIDAsync(loginRequest); var saveResult = await PfClient.ExecuteCloudScriptAsync(saveRequest); _onComplete?.Invoke(saveResult); } catch (Exception e) { var failResult = new PlayFabResult <ExecuteCloudScriptResult>(); failResult.Error = new PlayFabError(); failResult.Error.ErrorMessage = e.ToString(); _onComplete?.Invoke(failResult); } #endif }
public void PostTestResultsToCloudScript(TestSuiteReport testReport) { ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest { FunctionName = "SaveTestData", FunctionParameter = new Dictionary <string, object> { { "customId", PlayFabSettings.BuildIdentifier }, { "testReport", new[] { testReport } } }, GeneratePlayStreamEvent = true }; PlayFabClientAPI.ExecuteCloudScript(request, OnCloudScriptSubmit, OnCloudScriptError); }
private static void PostTestResultsToCloudScript(TestSuiteReport testReport) { #if !DISABLE_PLAYFABCLIENT_API var request = new ExecuteCloudScriptRequest { FunctionName = "SaveTestData", FunctionParameter = new Dictionary <string, object> { { "customId", PlayFabSettings.BuildIdentifier }, { "testReport", new[] { testReport } } }, GeneratePlayStreamEvent = true }; var saveTask = PlayFabClientAPI.ExecuteCloudScriptAsync(request); saveTask.ContinueWith(task => { if (_onComplete != null) { _onComplete(task.Result); } } ); #endif }