OnOtherDeviceLoginDetectedError
Description
This handler is called automatically when you use a currently connected account to log in with another device.
The handler is called when the following error is returned:
When the refresh_token expired because the user logged in to another device
statusCode : 401
errorCode : BadUnauthorizedException
For the handler to work, the BACKND Inspector window's Auto Refresh Token field must be enabled.
Example
void Start() {
if(Backnd.IsInitialized) {
Backnd.ErrorHandler.InitializePoll(true);
Backnd.ErrorHandler.OnOtherDeviceLoginDetectedError = () => {
Debug.Log("External login detected!!!");
gameObject.GetComponentInChildren<Text>().text = "Login detected from another device.";
};
}
}
void Update() {
if(Backnd.ErrorHandler.UseAsyncQueuePoll) {
Backnd.ErrorHandler.Poll();
}
}
External thread
void Start() {
Backnd.ErrorHandler.OnOtherDeviceLoginDetectedError = () => {
Debug.Log("External login detected!!");
};
}