void UnlinkMobileID(bool facebook) { if (Application.platform == RuntimePlatform.IPhonePlayer) { var unlinkIOSRequest = new UnlinkIOSDeviceIDRequest { DeviceId = GetMobileID() }; PlayFabClientAPI.UnlinkIOSDeviceID(unlinkIOSRequest, success => { PlayFabClientAPI.ForgetAllCredentials(); mobileLogin = false; if (facebook) { PlayfabLoginWithFacebook(); } else { //Login con google } }, failure => { DisplayError(ErrorCode.errorFacebookLoginIn, failure.Error.ToString()); }); } else if (Application.platform == RuntimePlatform.Android) { } }
void UnLinkMobileID(bool linkNew = false) { if (Application.platform == RuntimePlatform.IPhonePlayer) { var unlinkIOSRequest = new UnlinkIOSDeviceIDRequest { DeviceId = GetMobileID() }; PlayFabClientAPI.UnlinkIOSDeviceID(unlinkIOSRequest, result => { if (linkNew) { LinkMobileID(); } Debug.Log("Unlinked Mobile ID"); }, failed => { Debug.Log("failed to unlink Mobile ID"); }); } else if (Application.platform == RuntimePlatform.Android) { var unlinkAndroidRequest = new UnlinkAndroidDeviceIDRequest { AndroidDeviceId = GetMobileID() }; PlayFabClientAPI.UnlinkAndroidDeviceID(unlinkAndroidRequest, result => { if (linkNew) { LinkMobileID(); } Debug.Log("Unlinked Mobile ID"); }, failed => { Debug.Log("failed to unlink Mobile ID"); }); } else { var unlinkIOSRequest = new UnlinkIOSDeviceIDRequest { DeviceId = GetMobileID() }; PlayFabClientAPI.UnlinkIOSDeviceID(unlinkIOSRequest, result => { if (linkNew) { LinkMobileID(); } Debug.Log("Unlinked Mobile ID"); }, failed => { Debug.Log("failed to unlink Mobile ID" + failed.Error); }); } }
public void UnlinkDeviceFromAccount(Callback <bool> i_requestCallback) { StartRequest("Unlinking device from account"); #if UNITY_EDITOR UnlinkCustomIDRequest request = new UnlinkCustomIDRequest() { CustomId = SystemInfo.deviceUniqueIdentifier }; UnityEngine.Debug.LogError("Unlinking " + SystemInfo.deviceUniqueIdentifier); PlayFabClientAPI.UnlinkCustomID(request, (result) => { RequestComplete("UnlinkDeviceFromAccount() compete, success", LogTypes.Info); }, (error) => { HandleError(error, "UnlinkDeviceFromAccount() complete"); }); #elif UNITY_ANDROID UnlinkAndroidDeviceIDRequest request = new UnlinkAndroidDeviceIDRequest() { AndroidDeviceId = SystemInfo.deviceUniqueIdentifier }; UnityEngine.Debug.LogError("Unlinking " + SystemInfo.deviceUniqueIdentifier); PlayFabClientAPI.UnlinkAndroidDeviceID(request, (result) => { RequestComplete("UnlinkDeviceFromAccount() compete, success", LogTypes.Info); }, (error) => { HandleError(error, "UnlinkDeviceFromAccount() complete"); }); #elif UNITY_IOS UnlinkIOSDeviceIDRequest request = new UnlinkIOSDeviceIDRequest() { DeviceId = SystemInfo.deviceUniqueIdentifier }; UnityEngine.Debug.LogError("Unlinking " + SystemInfo.deviceUniqueIdentifier); PlayFabClientAPI.UnlinkIOSDeviceID(request, (result) => { RequestComplete("UnlinkDeviceFromAccount() compete, success", LogTypes.Info); }, (error) => { HandleError(error, "UnlinkDeviceFromAccount() complete"); }); #endif }
/// <summary> /// Unlinks a mobile device from a PlayFab account /// </summary> public static void UnlinkDeviceId() { if (GetDeviceId()) { PlayFabLoginCalls.RequestSpinner(); if (!string.IsNullOrEmpty(android_id)) { Debug.Log("Unlinking Android"); UnlinkAndroidDeviceIDRequest request = new UnlinkAndroidDeviceIDRequest(); PlayFabClientAPI.UnlinkAndroidDeviceID(request, OnUnlinkAndroidDeviceIdSuccess, OnPlayFabCallbackError); } else if (!string.IsNullOrEmpty(ios_id)) { Debug.Log("Unlinking iOS"); UnlinkIOSDeviceIDRequest request = new UnlinkIOSDeviceIDRequest(); PlayFabClientAPI.UnlinkIOSDeviceID(request, OnUnlinkIosDeviceIdSuccess, OnPlayFabCallbackError); } } }