Skip to content
No description, website, or topics provided.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
Group 11.png
README.md
Screenshot from 2019-03-25 14-22-45.png
Screenshot from 2019-03-25 14-32-01.png
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Mati Android SDK documentation

Our SDK requires Android v5.0 (API v21) or above.

alt text

Gradle configuration

  1. Ensure that your top-level build.gradle contains a reference to the following repository:

     jcenter()
    

alt text

  1. Open the build.gradle file inside your application module directory and include the following dependencies into build.gradle file of your app:

     implementation 'com.matilock:mati-global-id-sdk:2.3.4'
    

alt text

Once you make these two changes, simply sync your project with gradle.

Mati SDK initialization

In the onCreate() method of your application class, initialize Mati by calling the following line of code:

public class MyApplication extends Application {

@Override
public void onCreate() {
    super.onCreate();
    Mati.init(this, "your client ID here");
  }
}

Your application tag in manifest should include the application class that was created

<application
    android:name=".MyApplication"
    ...

Mati KYC Button Placement (UI)

You now need to place the Mati KYC button inside your App. Add it to your layout XML file:

<com.matilock.mati_kyc_sdk.MatiLoginButton
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:text="Custom"/>

Metadata

Choose what kind of metadata you want to receive as shown in example below.

Metadata metadata = new Metadata.Builder()
                .with("userId", "Your Client ID")
                .with("type", 2)
                .build();

Mati.getInstance().setMetadata(metadata);

Callback Registration

In order to handle login responses create a callback manager by calling following code:

private MatiCallbackManager mCallbackManager = MatiCallbackManager.createNew();

Now register callback to handle callback responses

MatiLoginManager.getInstance().registerCallback(mCallbackManager, new MatiCallback() {
            @Override
            public void onSuccess(LoginResult pLoginResult) {
                Log.d(TAG, "User finished verification process successfully!");
            }

            @Override
            public void onCancel() {
                Log.d(TAG, "User cancelled verification flow");
            }

            @Override
            public void onError(LoginError pLoginError) {
                Log.d(TAG, pLoginError.getMessage());
            }
        });

And in your onActivityResult method, call mCallbackManager.onActivityResult to pass the login results to the MatiLoginManger

@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    mCallbackManager.onActivityResult(requestCode, resultCode, data);
    super.onActivityResult(requestCode, resultCode, data);
  }

Mati Android SDK integration video

Mati SDK integration demo video

You can’t perform that action at this time.