Say you want to download your friends' entity files. Is it doable with Unity PlayFabClientAPI or you must use Cloud Script? Any hint or sample codes?
Say you want to download your friends' entity files. Is it doable with Unity PlayFabClientAPI or you must use Cloud Script? Any hint or sample codes?
You can use the entity API GetFiles to access a friend's entity files. However, files are not accessible by other players by default, you'd need to modify the profile policy for the players via the SetProfilePolicy API, for instance, a sample policy looks like:
{ "Resource": "pfrn:data--title_player_account!<enter title player id here>/Profile/Files/file1", "Action": "Read", "Effect": "Allow", "Principal": { "Friend": "true" }, "Comment": "friend can access file1" }
@Citrus Yan Thanks for your reply.
Can modify the profile policy manually in Game Manger dashboard or must be done by code using the SetProfilePolicy API?
When use entity API GetFiles, the Id in the request is player's or friend's Id?
var request = new GetFilesRequest { Entity = new PlayFab.DataModels.EntityKey { Id = entityId, Type = entityType } }; PlayFabDataAPI.GetFiles(request, resultCallback, OnSharedFileFailure);
Sure, you can manually modify the policy in GM, via Player Tab -> Policy -> Title Player Account:
And, the id should be of the player itself so that its friend can access the file.
4 People are following this question.