Skip to content

KaleemPatel23/AndroidSDK

 
 

Repository files navigation

Bureau SDK for Android

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
 repositories {
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

or if your repositories are managed from settings.gradle

dependencyResolutionManagement {
   repositories {
      ...
      maven { url "https://jitpack.io" }
    }
}

Step 2. Add the dependency

implementation 'id.bureau:AndroidSDK:1.3.6'

SDK Initialization

BureauAuth bureauAuth = new BureauAuth.Builder()
    .mode(BureauAuth.Mode.Sandbox)
    .clientId("Your Client Id")
    .build();
        //Other Options in builder are
        //timeOutInMs - total timeout
        //callbackUrl

Usage

AuthenticationStatus authenticationStatus = bureauAuth.authenticate(applicationContext,
    correlationId, msisdn);
// Possible AuthenticationStatus
// Completed("Authentication flow completed")
// NetworkUnavailable("Mobile network is not available")
// OnDifferentNetwork("Device is using a different network")
// ExceptionOnAuthenticate("Exception occurred while trying to authenticate")
// UnknownState("Unknown authentication state")

If authenticate() method returns the AuthenticationStatus Completed you can go ahead and wait for the callback from Bureau servers or poll the userinfo API.

For an example SDK usage, please take a look here

Minimum Android SDK Version

LOLLIPOP || 21

Dependencies expected

'com.squareup.okhttp3:okhttp:3.9.0' or compatible versions, ‘com.mixpanel.android:mixpanel-android:5.9.6’

Manifest changes

<application
    android:usesCleartextTraffic="true"

or if you are using network config

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="false">PLEASE CONTACT BUREAU TO GET DOMAIN</domain>
    </domain-config>
</network-security-config>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Java 100.0%