Skip to content

Mobile Integration

hubtel_auth is a package hosted on azure to enhance easy and quick integration of hubtel onboarding and login for flutter applications.

To add the hubtel_auth package to your project, Add the code below to your pubspec.yaml file.

NB: ref represents the version number of the package being used and subjected to change.

Yaml
hubtel_auth:
  git:
      url: [email protected]:v3/hubtel/Mobile-Apps/Platform-Library-Flutter-Hubtel-Auth
      ref: 0.0.2

Usage

Requirement

appId: An identifier for the application using the auth.

Implementation

dart
    _openLogin() async {
              //Start the login with the method below. This method returns a value of type LoginResult when the future resolves.
              final completedLogin = await HubtelAuth().startLogin("{Pass AppId here}");
              //go to your home screen once you get a token and a mobileNumber from completedLogin

}

LoginResult

This is an object the sdk returns back to the user of the sdk and it encapsultes the mobile number and the token of the user who logged in.

ParameterDescription
mobileNumberThe mobile number of the user.
tokenThe bearer token of the user.

Was this page helpful?

Happy React is loading...