login

fun login(    token: String,     provider: String,     completion: (String?, DittoError?) -> Unit)

Log in to Ditto with a third-party token.

The completion lambda will be called once, whether the login attempt succeeds or fails. If it has failed then the optional DittoError will be non-null, otherwise it will be null. Regardless of whether or not the login attempt succeeds the optional String argument will be non-null if the auth webhook endpoint returned any JSON data under the clientInfo key. That JSON is what will be passed via the String? argument, if it's provided.

Parameters

token

the authentication token required to log in.

provider

the name of the authentication provider.

completion

a lambda that will get called when the login attempt has completed.


fun login(    token: String,     provider: String,     completionCallback: DittoLoginCallback)

Log in to Ditto with a third-party token.

The completion lambda will be called once, whether the login attempt succeeds or fails. If it has failed then the optional DittoError will be non-null, otherwise it will be null. Regardless of whether or not the login attempt succeeds the optional String argument will be non-null if the auth webhook endpoint returned any JSON value under the clientInfo key. That JSON is what will be passed via the String? argument, if it's provided.

Parameters

token

the authentication token required to log in.

provider

the name of the authentication provider.

completionCallback

an object that implements the DittoLoginCallback interface, whose callback function will be called when the login attempt has completed.