Skip to main content

Quick Start

Source Code

Source code of the SDK can be found on Github.

You can have a look at the examples made on top of this SDK and try it out yourself.

Android demo

You can download Android demo apk from Google drive:

tip

The UniPass Wallet domain used in Demo project is: https://testnet.wallet.unipass.id/

Requirements

Android API version 21 or newer

Installation

  1. In your project-level build.gradle or settings.gradle file, add JitPack repository:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' } // Add this line
}
}
  1. In your app-level build.gradle dependencies section, add the following:
dependencies {
// Replace {Version} with the version you what. For example v0.0.5
implementation 'com.github.UniPassID:UniPass-Android-SDK:{Version}'
}
  1. Add UniPassActivity / Configure Deep Link

Open your app's AndroidManifest.xml file and add UniPassActivity activity in your application, add deep link intent filter to UniPassActivity activity: You can refer to the android developer documents

<activity
android:name="com.unipass.core.UniPassActivity"
android:exported="true"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Replace { scheme/host/path } with YOUR_APP_PACKAGE_NAME -->
<data
android:scheme="{scheme}"
android:host="{host}"
android:pathPattern="/*"
android:pathPrefix="/{path}" />
</intent-filter>
</activity>

If you are using v0.0.3 or below, you can add just deep link intent to your activity, but you should make sure your activity launchMode is set to singleTop

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- Accept URIs: {YOUR_APP_PACKAGE_NAME}://* -->
<data android:scheme="{YOUR_APP_PACKAGE_NAME}" />
<!-- For reference only -->
<data android:scheme="unipassapp"
android:host="com.unipass.wallet"
android:pathPattern="/*"
android:pathPrefix="/redirect" />
</intent-filter>

Make sure your sign-in activity launchMode is set to singleTop in your AndroidManifest.xml if you are using v0.0.3 or below

<activity
android:launchMode="singleTop"
android:name=".YourActivity">
// ...
</activity>

Open your app's AndroidManifest.xml file and add the following permission: <uses-permission android:name="android.permission.INTERNET" />

  1. Then you can use UniPassSDK in your project:
import com.unipass.core.UniPassSDK

History Version

VersionLast updatedUniPass Wallet Entry URLUPgrade Instruction
v0.0.152023.04.13https://testnet.wallet.unipass.id/Add forceLogin option for login api
v0.0.142023.03.28https://testnet.wallet.unipass.id/Fix switch user bug when sign-message and send-transaction
v0.0.132023.03.14https://testnet.wallet.unipass.id/Compatibility optimization. Remove dependencies from web3j. Optimize the handling of UnipassActivity
v0.0.122023.03.09https://testnet.wallet.unipass.id/Code optimization, remove all lateinit variables
v0.0.112023.02.07https://testnet.wallet.unipass.id/Move login parameter connectType to loginOption, and add more options like returnEmail, authorize etc to loginOption.
v0.0.102023.02.06https://testnet.wallet.unipass.id/Add optional parameter loginOption to the login method
v0.0.92023.02.03https://testnet.wallet.unipass.id/Add option deep for logout. Website state won't be cleared when deep is set to false
v0.0.82023.01.29https://testnet.wallet.unipass.id/Support buildType:minifyEnable
v0.0.72023.01.15https://testnet.wallet.unipass.id/Chore: Throw Exception when user close browser or interrupt process
v0.0.62023.01.13https://testnet.wallet.unipass.id/Add overload API login, allow connectType for login . Code optimizing
v0.0.52023.01.09https://testnet.wallet.unipass.id/Add UniPassActivity , remove requirements for singleTop launchMode . UniPassSDKOptions adds parameter: activity
v0.0.32023.01.04https://testnet.wallet.unipass.id/Add Connect / Transfer / Sign Message / Logout support