Halo, I am using Unity and Playfab. I want to do recovery from linked facebook account.
In my case,
device A > create account A > linked facebook A
device B > create account B > linked facebook A (it will unlink device A automatically)
***Above actions are good for me. ***
******And I don't know how to do the below step.******
account B get all data [Player Data (Title)] from account A > unlink the customID(device A) from account A
The result I want:
1) account B will get all data from account A
2) account A will never be login by any devices. No one can login it anymore.
3) device A > create account C (This action is also fine for me)
Does anyone provide me the code for result 1,2? Thanks a lot!!
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"); var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; var request = new LinkFacebookAccountRequest { AccessToken = aToken.TokenString, ForceLink = true} ; PlayFabClientAPI.LinkFacebookAccount(request,OnSuccess,OnError); } else{ Debug.Log("login failed"); } } } void OnSuccess(LinkFacebookAccountResult result){ Debug.Log("linked fb Successfully!"); GetAppearance(); } void OnError(PlayFabError Error){ Debug.Log("Error while lniked fb"); Debug.Log(Error.GenerateErrorReport()); } public void GetAppearance(){ PlayFabClientAPI.GetUserData(new GetUserDataRequest(), OnDataRecieved, OnError); } void OnDataRecieved(GetUserDataResult result){ Debug.Log("recieved user data"); if(result.Data != null && result.Data.ContainsKey("Level")){ leveltext.text = "Level: " + (result.Data["Level"].Value); //convert string to int level = int.Parse(result.Data["Level"].Value); }else{ Debug.Log("data not completed!"); } }