Android
These are the instructions for the SDK Android for setting up promotion.
Adding libraries to use¶
Add external libraries for using 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"
}
Using 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>
Using UA Deferred Deep Links¶
UA deferred deep links are invitation code links (URLs) provided to give invitation rewards to users, and they operate in the following two ways:
- When a user has the game app installed, clicking the link launches the game app, navigates to a specific location within the app, and then provides invitation rewards.
- When a user does not have the game app installed, clicking the link directs the user to the marketplace to install the game app. After installing and launching the game app, invitation rewards are provided through the identifier information included in the invitation link.
To use deferred deep links, add the following to your AndroidManifest.xml file.
<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 User Acquisition(UA). You can freely use either the existing method or the deferred deep link method.
The operation sequence for User Acquisition (UA) using UA Deferred Deep Links is as follows:
- User A shares a deferred deep link via a UA invitation link.
- When User B receives and accesses the app through the invitation link, the server analyzes the link information to confirm that B played the game at A's invitation: obtaining information for rewards.
- If the app is not installed on User B's device, the link guides them to install the app. If already installed, the app is launched and both A and B's information is sent to the promotion server.
Note
Deferred deep links guide users to install the app if it is not present, and deliver link information immediately after the app is launched post-installation.
Using direct links¶
Direct links are URLs that move users to a specific location within the game app (after installing the game app) when clicked, or expose specific webviews to encourage user engagement.
The destination address that users are directed to through direct links is configured in Hive Console > Direct Link Management, and various destinations such as marketplaces, specific locations within the game app (deep links), and specific webviews can be flexibly configured according to the user's OS environment.
The operation sequence when direct links are applied in conjunction with the game app is as follows:
- Share direct links as various destination links (market links, deep links, web URLs)
- When a user clicks a direct link, it operates as follows according to the destination configured in Hive Console > Direct Link Management: - Market navigation: Regardless of the user's game app installation status, navigate to the market link configured in Hive Console > Direct Link Management - In-app navigation (deep link) - If the game app is installed in the user environment: Navigate to the designated location within the game app (scheme deep link) - If the game app is not installed in the user environment: Navigate to the game app installation location in the market supported by each OS environment or the uninstalled user navigation URL configured when creating the deep link - Web URL: Regardless of the user's game app installation status, navigate to a specific webview outside the game
- When the user proceeds in the order of 'game app execution > login > User Engagement (UE) SetReady action', the game app executes events included in the link information (performing related functions or UI exposure, performing custom functions defined in UE, etc.)
Warning
When the game app is not installed in the user environment, the precautions regarding direct link behavior according to Hive SDK version are as follows:
- Hive SDK v4 below 25.10.0 - Encourages game app installation on the user's device who clicked the direct link, but if the game app is executed immediately after installation, direct link information is not delivered. - After game app installation is completed, clicking the direct link again delivers direct link information to the game app simultaneously with game app execution. Events are then performed.
- Hive SDK v4 25.10.0 and above - Encourages game app installation on the user's device who clicked the direct link, and if the game app is executed immediately after installation, direct links operate in two ways as follows: - The game app communicates with Hive SDK's promotion server to obtain direct link information. The promotion server checks the device history and communication information of the user who first clicked the direct link and delivers appropriate direct link information to the game app client. Events are then performed. - After game app installation is completed, clicking the direct link again delivers direct link information to the game app simultaneously with game app execution. Events are then performed.
To apply direct link functionality in Android target Hive SDK, add the following content 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}.directlink" />
</intent-filter>
</activity>
</manifest>