question

Nguyễn Long avatar image
Nguyễn Long asked

Change Player Avatar URL using Playfab CloudScript

My game using playfab and FBGraph link to get player avatar, i was make a mistake when update user avatar that I forget about update value height=500 at end of my fbgraph link
Can i using cloudscript to update value height=500 in playerprofilepicURL

CloudScript
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nguyễn Long avatar image Nguyễn Long commented ·

I currently using this code but kinda not work, please help

handlers.makeAPICall = function (args, context) {
  	var proFileViewContrain =  new PlayerProfileViewConstraints();
    proFileViewContrain.ShowAvatarUrl = true;
    var request = {
        PlayFabId: currentPlayerId,
      	ProfileConstraints : proFileViewContrain
    };
    var playerStatResult = server.GetPlayerProfile(request);
  	var jsonParse = JSON.parse(JSON.parse(playerStatResult).PlayerProfile);
  	var requestupdate = {
        PlayFabId: currentPlayerId,
      	ImgURL : jsonParse.ImgURL.concat("&height=500")
    };
  	var updateProfile = server.UpdatePlayerProfile(requestupdate);
};
0 Likes 0 ·

1 Answer

·
franklinchen avatar image
franklinchen answered

There’s no UpdatePlayerProfile API provided by PlayFab, please check the API reference. We can update PlayerProfile avatar URL via UpdateAvatarUrl API.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.