Prerequisite

Latest Version

Blocto Unity SDK supports two flows depending on whether the Blocto app is installed or not.

Blocto app installed

Based on development environment, you need to download the corresponding Blocto app for testing:

  • dev (after joining app distribution, you need to wait for releasing next version)

Blocto app not installed

SDK would open browser using Web SDK in your dApp to use the Blocto service. In Android, Blocto SDK provider CloseWebView method to close web view when user click back button.

if(Input.GetKey(KeyCode.Escape))
{
    walletProvider.CloseWebView();
}

You can setting ForcedUseWebView for use of the Web SDK instead the Blocto app.

walletProvider.ForcedUseWebView = true;

Blocto Unity SDK uses iOS Universal Links or Android Deep Link to bring back information from Blocto wallet app to yours. If you do not set iOS Universal Links or Android Deep Link in Developer Dashboard (production, dev) or any situation that can't open your app correctly.

  • iOS Universal Links setting. please add Associated Domains in Xcode project setting and add new path /blocto to your apple-app-site-association

  • Please add a new path /blocto to your apple-app-site-association

  • Android Deep Links setting, please add activity and intent-filter in yours AndroidManifest.xml

<activity android:exported="true"
          android:launchMode="singleTop"
          android:name="com.blocto.unity.CallbackActivity" 
          android:process="e.unity3d">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="blocto" />
    </intent-filter>
</activity>

Unity Build Setting

In Android, please add activity, intent-filter, uses-permission and queries in yours AndroidManifest.xml

<application
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name">
    <activity android:name="com.unity3d.player.UnityPlayerActivity"
              android:launchMode="singleTask"
              android:label="@string/app_name"
              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
        <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<queries>
    <package android:name="com.portto.blocto" />
    <package android:name="com.portto.blocto.staging" />
    <package android:name="com.portto.blocto.dev" />
</queries>

Last updated