question

Srinivasan Natarajan avatar image
Srinivasan Natarajan asked

Error name Update

public void Function()

{

var request = new UpdateUserTitleDisplayNameRequest

{

DisplayName = Input_nickname.text,

};

PlayFabClientAPI.UpdateUserTitleDisplayName(request,OnDisplayNameUpdate,OnPlayFabError);

}

This function comes with the error.

OnDisplayNameUpdate

error CS1503: Argument 2: cannot convert from 'method group' to 'Action<UpdateUserTitleDisplayNameResult>

Help me out

,

10 |1200

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

1 Answer

·
Rick Chen avatar image
Rick Chen answered

Is that written in Unity? If so, the error could be that the success callback function OnDisplayNameUpdate in your code is incorrectly defined.

Here is an example of an API call, with success callback and error callback:

  using PlayFab.ClientModels;
    public void Function()
    {
        var request = new UpdateUserTitleDisplayNameRequest
        {
            DisplayName = Input_nickname.text,
        };
        PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnDisplayNameUpdate, OnPlayFabError);
    }
    private void OnDisplayNameUpdate(UpdateUserTitleDisplayNameResult result)
    {
        Debug.Log("changed displayname: " +result.DisplayName);
    }
    private void OnPlayFabError(PlayFabError error)
    {
        Debug.Log(error.GenerateErrorReport());
    }
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.