Skip to content

MinterTeam/minter-android-profile

Repository files navigation

Minter Android Profile API SDK

Download License: MIT

Minter user profile (https://testnet.console.minter.network) sdk library

DEPRECATED SDK

Setup

Gradle root build.gradle

allprojects {
    repositories {
       // ... some repos
        maven { url "https://dl.bintray.com/minterteam/android" }
    }
}

project build.gradle

ext {
    minterProfileSDK = "0.2.6"
}

dependencies {
    // for testnet use suffix "-testnet"
    implementation "network.minter.android:minter-android-profile-testnet:${minterProfileSDK}"

    // for main net
    implementation "network.minter.android:minter-android-profile:${minterProfileSDK}"
}

Basic Usage

Initialize it

// some api requires auth token to get personal data
// this callback will called only when it required
//
// so save authorization bearer token after login/register in your secret storage to use it later
MinterProfileApi.initialize(new CallbackProvider<String>{
    @Override
    public String get() {
        return MySecretStorage.getSavedAuthToken();
    }
});

Usage

SDK uses retrofit http client see

// get auth (or other) repository
ProfileAuthRepository profileRepo = MinterProfileApi.getInstance().auth();

// login
LoginData loginData = new LoginData();
// ... fill data

// and send request
profileRepo.login(loginData).enqueue(new Callback<ProfileResult<User>>() {
    @Override
    public void onResponse(Call<ProfileResult<User>> call, Response<ProfileResult<User>> response) {
        // do something with response
    }

    @Override
    public void onFailure(Call<ProfileResult<User>> call, Throwable t) {
        // handle error
    }
});

For more examples, see our wallet app

Docs

TODO (javadocs available)

Build

TODO

Tests

TODO

Changelog

See Release notes

License

This software is released under the MIT License.

© 2018 MinterTeam edward.vstock@gmail.com, All rights reserved.