question

seancosgrave avatar image
seancosgrave asked

AddFriend not working with ContactEmailAddress from Player Profile

I am trying to use the AddFriend API, and add a friend by sending their email address in the "FriendEmail" field. The email address I am sending is the same one they added using AddOrUpdateContactEmail. I get "User not found" in the response to these requests. Why am I not able to add a friend using their contact email address?

I found that I had to use the email address on the master account in order to add the friend. Is there an API that allows that email to be set, so I can keep it in-sync with the contact email address?

Friends
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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> Why am I not able to add a friend using their contact email address?

Currently, AddFriend API is designed to only one of FriendEmail(LoginEmail), FriendPlayFabId, FriendTitleDisplayName or FriendUsername can be used to retrieve and add a friend. The contact email is not contained in them. You can try to add a feature request of using FriendContactEmail to retrieve a friend.

>> Is there an API that allows that email to be set, so I can keep it in-sync with the contact email address?

Yes, there is an API AddUsernamePassword that can be used to add the username, password and email auth to an existing account created via an anonymous auth method, e.g. automatic device ID login. But this API can’t be used to update player account’s login email who already linked to these auth info. If the users haven’t linked any account auth yet, you can try this API to them.

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.

seancosgrave avatar image seancosgrave commented ·

I may add a request to update the docs on AddFriend as well, to make it more clear that FriendEmail is the login email, not the contact email. Thanks for the answer.

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.