Hi,
I want to use cloudscript for removing members from group using this API. I have written a function using the best of my knowledge of Playfab's Cloudscripting
here's my cloud code:
handlers.leaveGroup = function(args,context){ var removeGroupMember = { "Group":{ "Id": args.groupID }, "Members":{ "Entity":{ "Id": args.userID, "Type": "title_player_account", "TypeString": "title_player_account" } } }; var response = entity.RemoveMembers(removeGroupMember); return response; };
When I send the request from my game I get the response as NULL and I don't understand why it is happening.
here's my code from my game:
internal void LeaveGroup(string _groupID) { requestCompleted = false; PlayFabAuthenticationAPI.GetEntityToken(new PlayFab.AuthenticationModels.GetEntityTokenRequest(), result => { ExecuteCloudScriptRequest cloudCodeRequest = new ExecuteCloudScriptRequest { FunctionName = "leaveGroup", FunctionParameter = new { groupID = _groupID, userID = result.Entity.Id } }; PlayFabClientAPI.ExecuteCloudScript(cloudCodeRequest, OnSuccessfulResponse, OnFailedResponse); }, OnFailedResponse); } private void OnSuccessfulResponse(ExecuteCloudScriptResult result) { Debug.Log("Success"); Debug.Log(result.FunctionResult); } private void OnFailedResponse(PlayFabError error) { Debug.LogError("Error Report: " + error.GenerateErrorReport()); }