question

ahmed.yalahwy@gmail.com avatar image
ahmed.yalahwy@gmail.com asked

Error in UpdateUserTitleDisplayName API

Hello , why this code does not work and give me error : "Name not available"

public static void DisplayName(string name)
{
UpdateUserTitleDisplayNameRequest request = new UpdateUserTitleDisplayNameRequest()
{
DisplayName = name
};
PlayFabClientAPI.UpdateUserTitleDisplayName(request, (result) =>
{
Debug.Log("SUCCESS : " + result.DisplayName);
}
, (error) =>
{
Debug.Log("Error" + error.Error.ToString() + "\n");
Debug.Log(error.ErrorMessage);
Debug.Log(error.HttpCode);
});
}

10 |1200

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

brendan avatar image
brendan answered

That would be because another account has that name already. What Title ID are you using for this test, and what is the name?

10 |1200

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

ahmed.yalahwy@gmail.com avatar image
ahmed.yalahwy@gmail.com answered

maybe , so

can I delete the users in my game (I just was testing the backend and user authontecation operations) they are not real users

Title ID : 4F82

name : Ahmed

10 |1200

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

brendan avatar image
brendan answered

Yes, you can use the Admin/DeleteUsers API call to do this.

10 |1200

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

ahmed.yalahwy@gmail.com avatar image
ahmed.yalahwy@gmail.com answered

Hello

is the DisplayName must be unique ??

I want to display the player names (and it`s normal to be duplicated)

my name is "Ahmed" and my friend name is "Ahmed" too :))

10 |1200

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

brendan avatar image
brendan answered

That's correct. As stated in the docs, the Username must be unique across all titles in your Publisher ID, while the Title Display Name must be unique for the Title ID. We're looking at also making a namespace which is non-unique on the player account, but in the meantime, you could use User Data to set a value that you use for this.

10 |1200

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

Hamza Lazaar avatar image
Hamza Lazaar answered

Hi Brendan,

I think the UpdateUserTitleDisplayName docs page should be updated. 

In "Possible Error Codes", NameNotAvailable (1058) should replace UsernameNotAvailable (1009).

10 |1200

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

brendan avatar image
brendan answered

Thanks, Hamza - we'll get that updated.

10 |1200

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

brendan avatar image
brendan answered

We now provide you with the ability to make Title Display Names non-unique in your titles. Simply go to your title's Settings->API Features tab and select the "Allow non-unique player display names" option. Please be aware that this change is one-way. You will not be able to change a title from allowing non-unique display names back to requiring unique display names.

10 |1200

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

Damian Rajamanie avatar image
Damian Rajamanie answered

To enable the non-unique names, the option is actually now located in Settings->General

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.