Android
These are the instructions for the Hive SDK Android for setting up promotion.
Adding libraries to use¶
Add external libraries for using Hive SDK Promotion to the module level build.gradle file. Below is an example of build.gradle.
dependencies {
// Promotion
implementation "com.com2us.android.hive:hive-promotion"
// Promotion Google In-App Review
implementation "com.com2us.android.hive:hive-promotion-google-inappreview"
// Add this if you want to use Promotion video function.
implementation "com.com2us.android.hive:youtube-helper"
}
Setting up deep links¶
Deep links are links that move users to a specific location in the app after launching the app. Promotion User Engagement supports processing for deep link schemes. To use deep links, add the following to AndroidManifest.xml.
<manifest>
<activity android:name="YOUR_MAIN_ACTIVITY">
<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="${applicationId}" />
</intent-filter>
</activity>
</manifest>
Setting up deferred deep links¶
Deferred deep links are links that, if the user does not have the app installed, direct the user to the app market to install the app, and then move the user to a specific location in the app after launching the app. Users who have already installed the app will be taken to a specific location in the app after launching the app. To use deferred deep links, add the following to AndroidManifest.xml.
<activity
android:name="com.hive.userengagement.DeferredDeeplinkActivity"
android:exported="true">
<!-- Add this when using the sandbox server -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="sandbox-promotion.qpyou.cn"
android:pathPattern="/deeplink/${applicationId}/vid/.*" />
</intent-filter>
<!-- Add this when using the production server -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="promotion.qpyou.cn"
android:pathPattern="/deeplink/${applicationId}/vid/.*" />
</intent-filter>
</activity>
Deferred deep links only support Google Play Store on Android. Configure it if you want to share friend invitation links through Hive User Acquisition(UA). You can freely use either the existing method or the deferred deep link method.
Existing UA Friend Invitation Link | UA Friend Invitation Link through Deferred Deep Link | |
Behavior | - When accessing the invitation link, users are guided to install and run the game through a web page with a UI that induces game installation and execution. - The invitation link does not contain any separate information. | - When accessing the invitation link, the user is guided to install the game (move to the market) and run the game without a separate web page. - Information can be included in the invitation link (controlled by Hive SDK). |
Supported Platforms | - When inducing installation, each market URL can be arbitrarily implemented on a self-implemented web page. | - Only Google Play Store is supported (available only when accessed through Chrome browser). |
When the deferred deep link is set, the sequence of operations of the Hive User Acquisition (UA) function is as follows:
- User A shares a link in the form of a deferred deep link through a UA invitation link.
- When user B, who received the invitation link, accesses the app through the link, the server analyzes the link information to confirm that B played the game at the invitation of A: obtaining information for reward.
- The deferred deep link is provided as a single link, and if the app is not installed on user B's device, it induces app installation. If the app is already installed, it launches the app and transmits the information of user A and user B to the promotion server.