Proper LinkPlatform...
 
Notifications
Clear all

Proper LinkPlatform usage?

3 Posts
2 Users
1 Reactions
952 Views
(@dustin1138)
Posts: 21
Eminent Member
Topic starter
 

Hello! I'm having trouble properly integrating LinkPlatform. 

Currently,  users can start my game with a Facebook registration or guest registration (with no requested email or password). If a guest later decides to upgrade their guest account to a Facebook account then I assume I'd use LinkPlatform to accomplish this. But how do I detect if the Facebook userID that I want to link to this guest account has been previously registered? Right now I have my Facebook id registered. If I log out and return to a guest account and then request the Facebook upgrade, I run the LinkPlatform command and it returns a positive success response. Although, it shouldn't since that Facebook ID was already registered. And if I log back in to the Facebook registration, it returns to that original combu account not the account that was associated with the guest account. At this point, don't I have 2 combu accounts with the same Facebook ID associated with them? Am I approaching this wrong? Or is there another way to detect if a Facebook ID is already registered before using the LinkPlatform command?

Thanks in advance.

 
Posted : 24/09/2018 11:48 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

When a currently authenticated account wants to link its Facebook ID (or other external platform ID) the best way would be to first see if that platform ID is existing by calling User.LoadPlatform: if another account exists (with user.id [not platform ID] different from the currently logged id) then you should notify the user that the platform ID is already associated to another account. If the user wants to transfer the platforms from an account to another one then he should login with the account from which transferring and once authenticated you'll call localUser.LinkAccount passing the username and password of the account to which the platforms will be transferred (the "old" account will be automatically deleted).

It's probably explained better in the documentation page, or in the intellisense tooltip of user.LinkAccount.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 25/09/2018 6:24 pm
fau reacted
(@dustin1138)
Posts: 21
Eminent Member
Topic starter
 

Bingo, that's what I couldn't find. Thanks!

 

 
Posted : 26/09/2018 1:07 am
Share: