Skip to main content
Version: 6.0.0

RegisterAutoReconnectCallback

Registers a callback handler that is invoked whenever the client automatically re-authenticates due to session expiration. The callback receives a JSON string describing the result of the re-authentication attempt, whether successful or failed.

This callback is used in conjunction with EnableAutoReconnect on the wrapper (or EnableAutoReconnect on the comms layer directly).

Method Parameters

ParameterDescription
callbackA LongSessionCallback delegate that takes a JSON response string as its only parameter.

Usage

http://localhost:3000
void autoReconnectCallback(string jsonResponse)
{
// handle re-authentication result
}

_bc.RegisterAutoReconnectCallback(autoReconnectCallback);
JSON Response
// On success - authentication response JSON
{
"status": 200,
"data": {
"profileId": "1234-1234-1234-1234",
"newUser": false
}
}

// On failure - error response JSON
{
"status": 403,
"reason_code": 40300,
"status_message": "Message describing failure",
"severity": "ERROR"
}