Authentication

Overview

You can use the following methods to manage the authentication and login state of the driver:

Methods

logout

Use to logout a driver.

public void logout()

Parameters

None

loginWithPhone or loginWithEmail

Use to login a driver using with credentials. The credentials can be either

  • email and password
  • phone and confirmation code

Those methods triggers a callback.

public void loginWithPhone(String phone, String confirmationCode, String merchantId,
                                     String countryCode, LoginCallback callback)

Parameters

callback

LoginCallback

Use to implement a new LoginCallback instance, including the callback interface methods that will be invoked by the Bringg Driver SDK for Android for login events.

countryCode

String

The country code of this driver.

email

String

The email address of the driver logging in.

merchantId

String

The Id of the merchant to which this driver is associated.

password

String

The password matching of the driver logging in.

phone

String

The phone number of the driver logging in.

loginWithQRCode

Use to login a driver using QR code. This method triggers a callback.

public void loginWithQRCode(String region, String token, String secret, LoginCallback callback)

Parameters

callback

LoginCallback

Use to implement a new LoginCallback instance, including the callback interface methods that will be invoked by the Bringg Driver SDK for Android for login events.

region

String

The region of the driver logging in.

secret

String

The secret key of the driver logging in.

token

String

The access token of the driver logging in.

forgotPassword

Use to resend a forgotten password. This method triggers a callback.

public void forgotPassword(String email, String countryCode, ResendPasswordCallback callback)

Parameters

callback

ResendPasswordCallback

Use to implement a new ResendPasswordCallback instance, including the callback interface methods that will be invoked by the Bringg Driver SDK for Android for resent password events.

countryCode

String

The country code of this driver.

email

String

The email address of this driver whose password is requested.

requestConfirmation

Use to request a confirmation code. This method triggers a callback.

public void requestConfirmation(String phone, String countryCode, RequestConfirmationCallback callback

Parameters

callback

RequestConfirmationCallback

Use to implement a new RequestConfirmationCallback instance, including the callback interface methods that will be invoked by the Bringg Driver SDK for Android for request confirmation code events.

countryCode

String

The country code of this driver.

phone

String

The phone number of this driver.

LoginCallback

You must provide this interface as an argument for the login method.

onLoginFailed

Invoked when a login event fails.

void onLoginFailed()

onLoginCanceled

Invoked when a login event is canceled.

void onLoginCanceled()

onLoginSuccess

Invoked when login event succeeds.

void onLoginSuccess()

RequestConfirmationCallback

You must provide this interface as an argument for the request confirmation method.

onRequestConfirmationSuccess

Invoked when a request a confirmation code event succeeds.

void onRequestConfirmationSuccess()

onRequestConfirmationError

Invoked when a request a confirmation code event results in an error.

void onRequestConfirmationError()

onRequestConfirmationCanceled

Invoked when a request a confirmation code event is canceled.

void onRequestConfirmationCanceled()

ResendPasswordCallback

You must provide this interface as an argument for the resend password method.

onResendPasswordSuccess

Invoked when a resend password event succeeds.

void onResendPasswordSuccess(String emailSent)

Parameters

emailSent

String

The email whose password is requested.

emailSent

String

The email whose password is requested.

Parameters

onResendPasswordFailure

Invoked when a resend password event fails.

void onResendPasswordFailure(String emailSent)

onResendPasswordCanceled

Invoked when a resend password event is canceled.

void onResendPasswordCanceled()