bindAutomatically

fun bindAutomatically(onBindSuccessful: () -> Unit = {}, onUnbind: () -> Unit = {}, onBindFailure: (GatewayBindingException) -> Unit)

The app will automatically bind when the application is in the foreground, and unbind when the app is moved to the background. Only call this method once.

Parameters

onBindSuccessful

called on every successful bind to the gateway

onUnbind

called on every unbind to the gateway

onBindFailure

called if the binding failed, usually because the Gateway app is not installed on the device