question

Arjuna avatar image
Arjuna asked

Searching for a friend by player name/email/id

I know there's methods to add a friend using their ID, email or username, but is there a way to search for a friend using any of those fields?

For example, I search for "Joe" and get 10 results and pick the one I know to be my friend and add them to my friend list. 

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.

shashi avatar image shashi commented ·

Hi Arjuna, Do you get any soultion for that.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

You can retrieve users by PlayFab ID, Username, Title Display Name, or Email address, but they do need to match. A wildcard or substring search would require a scan operation across the data table, which is an inefficient (and so expensive) operation. One thing you could do, to make it easier for groups of friends to find each other, would be to use Shared Group Data to let people connect with a group of users in the game, so that when a new person connects to that, he could see all the users that have been added to it. We'll be providing a group/clan feature later on which will provide for this in a simpler manner, as well.

3 comments
10 |1200

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

Arjuna avatar image Arjuna commented ·

That makes sense, thank you! 

For now I've just set it up to call the commands one after another where it first tries to add friend by username, if that fails, try to add by email and if that fails let the user know that I couldn't find the player they were trying to add. 

0 Likes 0 ·
shashi avatar image shashi commented ·

Hi Brendan,

I am trying to get the Account info by setting the Title Display Name in "GetAccountInfoRequest" and used the PlayFabClientAPI.GetAccountInfo but not getting any response. Can you please help me out. Basically I want to make the search friends by name so I want to get all users who match that substring, is that possible ?


0 Likes 0 ·
brendan avatar image brendan shashi commented ·

No, searching on a user is on a match only - it's not a wildcard match, as that could return thousands, or even millions, of records.

0 Likes 0 ·

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.