question

c-ming2004 avatar image
c-ming2004 asked

Unlinking facebook and delete the old account,unlinking facebook account

Halo, I am new user of Unity and Playfab. I learn from youtube step by step.

In my situation,

device A > LoginWithCustomID A > linked facebook A

device B > LoginWithCustomID B > linked facebook A (unlink facebook A from CustomID A)

(LoginWithCustomID A = deleted)

device A > LoginWithCustomID C

May I know how to set up a button for unlinking facebook account and delete the customID A with VS code?

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

c-ming2004 avatar image c-ming2004 commented ·

Thanks for your answer.

In my case, player already LoginWithCustomIDRequest. And I want they can link with facebook account for backup.

public void FBlogin(){

List<string> permessions = new List<string>();

permessions.Add("public_profile");

FB.LogInWithReadPermissions(permessions,AuthCallResult); }

void AuthCallResult(ILoginResult result){

if(result.Error != null){

Debug.Log(result.Error);

}else{

if(FB.IsLoggedIn){

Debug.Log("FB logged in");

FB.API("/me?fields=first_name",HttpMethod.GET, callbackDate);

} else{

Debug.Log("login failed"); }

}

}

Should I use LinkFacebookAccountRequest instead of FB.LogInWithReadPermissions?

If I use LinkFacebookAccount, I had tried as below:

public void linkfacebookbutton(){

var request = new LinkFacebookAccountRequest {

AccessToken = "{your access token}",

ForceLink = true};

PlayFabClientAPI.LinkFacebookAccount(request,OnSuccess,OnError);

}


where should I type "{your access token}" in VScode?

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

If you force to link Facebook A to device B's account (with "ForceLink" property setting true in the request), the Facebook account will unlink from A then link to B. You don't have to unlink it first.

Since Custom ID should be random and unable to re-use. I don't think it necessary to delete A because Deletion is metered as Profile Writes, which is unnecessary cost. Leaving it alone should be fine. Meanwhile, deletion is an administrative action and Login identity is stored in Master Player account, it is required to use DeleteMasterPlayerAccount Admin API for deletion. You need to implement this API on your own server or with Azure Function.

May I know more details about your scenario?

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.

c-ming2004 avatar image c-ming2004 commented ·

Thanks for your answer.

In my case, player already LoginWithCustomIDRequest. And I want they can link with facebook account for backup.

public void FBlogin(){

List<string> permessions = new List<string>();

permessions.Add("public_profile");

FB.LogInWithReadPermissions(permessions,AuthCallResult); }

void AuthCallResult(ILoginResult result){

if(result.Error != null){

Debug.Log(result.Error);

}else{

if(FB.IsLoggedIn){

Debug.Log("FB logged in");

FB.API("/me?fields=first_name",HttpMethod.GET, callbackDate);

} else{

Debug.Log("login failed"); }

}

}

Should I use LinkFacebookAccountRequest instead of FB.LogInWithReadPermissions?

If I use LinkFacebookAccount, I had tried as below:

public void linkfacebookbutton(){

var request = new LinkFacebookAccountRequest {

AccessToken = "{your access token}",

ForceLink = true};

PlayFabClientAPI.LinkFacebookAccount(request,OnSuccess,OnError);

}

where should I type "{your access token}" in VScode?

0 Likes 0 ·
c-ming2004 avatar image c-ming2004 commented ·

I mean ***what should I type "{your access token}" in VScode? ***

thanks

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ c-ming2004 commented ·

It is an access token from Facebook, you may need to implement Facebook SDK to get this token. PlayFab simply uses this token to verify the player with Facebook server.

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.