I am having lots of trouble getting and updating shared group data at the moment.
In postman:
All client.GetSharedGroupData return 200: OK with empty data[] no matter what I put in for GroupId, etc. (Members:[] is present and returns an empty array if GetMembers:true, and is NOT present if GetMembers:false - so at least that is doing something)
All server.GetSharedGroupData returns InvalidSharedGroupId.
In CloudScript, the following function returns InvalidSharedGroupId:
handlers.writeGroupData = function(args, context) { var writeData = server.UpdateSharedGroupData( { SharedGroupId: args.groupID, Data: args.Data } ); };
(I will be doing some data scrubbing and roles checks later, just trying to get the damn thing working right now.)
So I switched to Unity SDK, and the following :
public static void GetSharedGroupData(string ID, List<string> keys) { var request = new GetSharedGroupDataRequest { SharedGroupId = ID, GetMembers = true, Keys = keys }; PlayFabClientAPI.GetSharedGroupData(request, OnGetSharedGroupData, OnPlayFabError); }
Returns same as client posts through Postman (200:OK and a blank Data object).
trying to UpdateSharedGroupData through Unity, this returns a different error (this is after login, and yes the player is an admin of the shared group). I've tried passing both the sharedgroup ID and the sharedgroup name (why do docs use group name? Is that valid <anywhere> !?)
public static void UpdateSharedGroupData(string ID, Dictionary<string, string> data) { var request = new UpdateSharedGroupDataRequest { SharedGroupId = ID, Data = data, Permission = UserDataPermission.Public }; PlayFabClientAPI.UpdateSharedGroupData(request, OnUpdateGroupData, OnPlayFabError); }
PlayFabError: { "ApiEndpoint": "/Client/UpdateSharedGroupData", "HttpCode": 401, "HttpStatus": "Unauthorized", "Error": 1089, "ErrorMessage": "NotAuthorized" }
I am striking out all three ways I know how to test and implement this, what gives?