question

Martin Brandel avatar image
Martin Brandel asked

Retrieving and setting multiple CustomId's for a player account.

Hello, I saw @Brendan mention in this issue: Linking Multiple Of Same Platform that retrieving multiple ID's for android/IOS was going to be in a future sprint, but I couldn't find any more info on this.

For my use-case I would like to save multiple CustomId's to a single account, and retrieve them on login. InfoResultPayload.AccountInfo.CustomIdInfo.CustomId seems to only retrieve the most recent. Is there any functionality for retrieving multiple or do I just have to try and link it each time I need to check if one is already linked?

Account Management
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

You can use the API LinkAndroidDeviceID/LinkIOSDeviceID to link the Android/iOS device Id to the existed account instead of using LinkCustomID. Then you can call the API GetAccountInfo to retrieve the latest Android/iOS device Id and the latest custom Id. Since the API GetAccountInfostill only returns the most recently linked Id for every Id type, so if your players need to link multiple Android/iOS device Ids or multiple Custom Ids to one account, you can consider storing linked Ids to the read-only player data or the internal player data. Besides, please note that setting the permission of the data as Private to prevent the potential security issues.

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

Martin Brandel avatar image Martin Brandel commented ·

Alright thanks; is this functionality going to be added soon? Would help with deciding whether its worth implementing such a solution.

Secondly, is there any advantage to using LinkAndroidDeviceID/LinkIOSDeviceID instead of link custom ID other than allowing to check for 3 devices without a player data implementation?

For example, if I want to use custom ID's for all devices to avoid issues if they change for whatever reason. <- This and simplicity is the main reason I am using custom ID's for linking any device. Is there any best practice reason this is not a good idea?

Thanks.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Martin Brandel commented ·

>> Alright thanks; is this functionality going to be added soon?

Could you please clarify which feature you asked?

>> Secondly, is there any advantage to using LinkAndroidDeviceID/LinkIOSDeviceID instead of link custom ID other than allowing to check for 3 devices without a player data implementation?

Using these APIs can bind the mobile devices more specifically. You can bind more device information, such as the OS version, device model to the player account through the APIs LinkAndroidDeviceID/LinkIOSDeviceID.

>> Is there any best practice reason this is not a good idea?

If you will use the feature -- Push Notifications, you must bind the correct device Ids for players so that PlayFab can register the players to the Google or Apple notification channel. CustomIDs can only be used to log them in.

0 Likes 0 ·
Martin Brandel avatar image Martin Brandel Sarah Zhang commented ·

>> Alright thanks; is this functionality going to be added soon?

> Could you please clarify which feature you asked?

The ability to bind and extract multiple CusomID's for one account.

0 Likes 0 ·
Show more comments

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.