question

John Peterson avatar image
John Peterson asked

Retrieve GenericID from account?

Dear PlayFab community,

When specifying PlayerProfileViewConstraints.ShowLinkedAccounts — it does not seem like the GenericIDs that are linked to the account are being returned. Can someone confirm? Is there another way to retrieve the GenericIDs?

Thanks in advance!

apis
10 |1200

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

Seth Du avatar image
Seth Du answered

PlayerProfileViewConstraints is a class contains Boolean variables, and ShowLinkedAccounts is one of them.

Normally, This class is used in GetPlayerProfileRequest. Initialize a PlayerProfileViewConstraints instance setting ShowLinkedAccounts equals to true and you can get what you want in the success callback.

GenericID is actually named GenericServiceId, you can get a list of them from the successful callback I mentioned before, that is SuccessCallback.PlayerProfile.LinkedAccounts.

For example in C#:

PlayFabAdminAPI.GetPlayerProfile(
    newPlayFab.AdminModels.GetPlayerProfileRequest  
    {
	PlayFabId = "XXXXXXXXXXXXXXXXX", 
	ProfileConstraints =  new PlayFab.AdminModels.PlayerProfileViewConstraints 
	{ 
 	    ShowLinkedAccounts = true 
	}  
    },  

    OnSuccess => 
    {
	// LinkedAccounts here is a list that is GenericIDs you may want to use 
	print(OnSuccess.PlayerProfile.LinkedAccounts);  

    },  
    OnError =>  

    { 
	print(OnError.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.

John Peterson avatar image
John Peterson answered

Thanks, @SethDu! I've tried this in a slightly different context (returning the UserProfile with the login). I'm getting other Linked Accounts (CustomID and GameCenter) but NOT the GenericID. So I wondered if there was some other mechanism to retrieve the data?

9 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.

Seth Du avatar image Seth Du ♦ commented ·

all accounts that linked to the player are in LinkedAccounts.

You can check Docs about PlayerLinkedAccount. When you get the list, you can make an iteration to retrieve all the entries in the list. There is a property named Platform, which will mark out what account it is in this entry.

0 Likes 0 ·
John Peterson avatar image John Peterson Seth Du ♦ commented ·

Yes, I have done this. My PlayFab account has 3 linked accounts: CustomID, GameCenter, and GenericID. Only 2 objects are returned in LinkedAccounts, the GenericID is missing. :-(

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ commented ·

We currently do not provide the function you mentioned. GenericID is invisible even in Game Manager.

The Generic ID system was added to provide a way for titles to let players register any other service ID as "belonging" to the user, so that others can find the user from that ID, rather than the other way around.

please check more details from Brendan here.

0 Likes 0 ·
John Peterson avatar image John Peterson commented ·

Thank you for the update, @SethDu! Man...that really stinks. Particularly, too, because you can only remove the GenericID if you already know the GenericID. <sigh>

0 Likes 0 ·
brendan avatar image brendan John Peterson commented ·

The thing to bear in mind is that the Generic IDs aren't "linked" to the account in any real way - they're information only, and cannot be used for authentication. What specifically are you trying to use the Generic ID system to do though? There may be a better approach.

0 Likes 0 ·
John Peterson avatar image John Peterson brendan commented ·

Thanks, @Brendan! I'm trying to provide an alternate key for our users. Ideally I would use the CustomID functionality, but inexplicably there is no lookup feature by CustomID for either client or server. I am inclined to use GameCenter, but I was told that feature may actually do a server-side validation in the future. I thought I would try to use GenericID, but the data is not returned (as you point out).

The whole LinkedAccount aspect feels incomplete. There are some features/functionality on the client, but not on the server or vice-versa. Ideally, if you support a LinkedAccount, there should be interfaces with which to perform a lookup by that LinkedAccount. :-(

0 Likes 0 ·
Show more comments
Anas Siraj avatar image Anas Siraj commented ·

Hi @Brendan, @SethDu,

I can confirm that I am not seeing Generic IDs in linked account as well. Can you all confirm if this is an issue or if Generic IDs is completely phased out?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Anas Siraj commented ·

Please refer to Brendan's answer above, Generic ID is "information" information instead of login identity, hence it won't be displayed in Linked Account.

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.