Skip to content

human-internet/humanid-android-sdk

Repository files navigation

humanID Android SDK

General DocumentationWikiIntegrationContributingGalleryFAQ

Meet humanID - An anonymous online identity, enabling platforms to offer the speed and comfort of social logins, while guaranteeing absolute privacy and protecting our communities by permanently blocking bots, spams, and trolls.

Requirements

  • API level 21 or higher
  • Build with Kotlin

Please update to the latest SDK!

Downloads

allprojects {
    repositories {
    ...
    maven { url 'https://jitpack.io' }
    }
}
.
.
.
dependencies {
    implementation 'com.github.human-internet:humanid-android-sdk:Tag'    
}

Credentials Access

Get the appId and appSecret by dropping us an email developers@human-id.org.

Configuration

Build the object easier just with this

val humanIdSDK: HumanIdSDK? by lazy {
  HumanIdSDK.Builder()
    .withActivity(this)
    .addClientId(getString(R.string.client_id))
    .addClientSecret(getString(R.string.client_secret))
    .setDefaultLanguage(SupportedLanguage.FRENCH)
    .setPriorityCountryCodes(arrayOf(
      CountryCode.UNITED_STATES,
      CountryCode.FRANCE,
      CountryCode.JAPAN,
      CountryCode.INDONESIA
    )).build()
}

Use in project

Add these codes into your Activity, we recommend you wrap this in a function that handles the login button.

humanIdSDK?.login()

//And in onActivityResult()
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    val exchangeToken = humanIdSDK?.getHumanIdExchangeToken(requestCode, resultCode, data)
}

You're set!

Now you can integrate your Android app to humanID. See the full sample here to learn more.

License

Copyright 2019-2020 Bluenumber Foundation Licensed under the GNU General Public License v3.0