Android
This page guides how to setup the Hive SDK Android payment feature.
Hive Console configuration¶
To use Hive SDK billing, you need to first configure Payment Provider Setup such as key value registration and market linkage in the Hive Console Billing.
Note
For more details, please refer to Google Market Account Registration.
Add market¶
You need to add the corresponding external library to the module level build.gradle file. Only add the market (payment provider) you will use.
Below is an example of adding an external library to the module level build.gradle file.
dependencies {
// IapV4, will be automatically included when adding the Market below.
implementation "com.com2us.android.hive:hive-iapv4"
// IapV4 Market, add only the Market you are using.
// Amazon
implementation "com.com2us.android.hive:hive-iapv4-market-amazon"
// Google
implementation "com.com2us.android.hive:hive-iapv4-market-google"
// Huawei
implementation "com.com2us.android.hive:hive-iapv4-market-huawei"
// Lebi
implementation "com.com2us.android.hive:hive-iapv4-market-lebi"
// ONEStore
implementation "com.com2us.android.hive:hive-iapv4-market-onestore"
// Samsung
implementation "com.com2us.android.hive:hive-iapv4-market-samsung"
// Hive Store
implementation "com.com2us.android.hive:hive-iapv4-market-hivestore"
}
Additional settings by market¶
Additional settings are required depending on the market.
Huawei payment setup¶
This section provides setup instructions for using Huawei payments.
- Add agconnect-services.json
- Add the agconnect-services.json file downloaded from the Huawei console to the Project folder.
- Project - build.gradle file configuration
- Add the AppGallery Connect plugin and Maven address.
buildscript { repositories { google() jcenter() // Huawei HMS Core SDK. maven {url 'https://developer.huawei.com/repo/'} } dependencies { ... // Huawei AppGallery Connect plugin classpath 'com.huawei.agconnect:agcp:1.9.1.301' } } allprojects { repositories { google() jcenter() /// Huawei HMS Core SDK. maven {url 'https://developer.huawei.com/repo/'} } }
- Add the AppGallery Connect plugin and Maven address.
- App - build.gradle file configuration
- Add Huawei library and plugin.
Samsung GalaxyStore payment setup¶
This section provides instructions for configuring Samsung GalaxyStore payments.
-
In the module-level build.gradle file, set the dependency for the libs folder.
-
Add the external library samsung_iap_sdk-v6.1.aar from the Hive SDK distribution version to the module-level libs folder.
-
In the module-level build.gradle file, remove QQ, WeChat, Huawei, and Hive Lebi libraries. If these libraries are included in the app build, the app may be rejected during the Galaxy Store review process.
dependencies { // List of libraries to exclude for Galaxy Store distribution build implementation "com.com2us.android.hive:hive-authv4-provider-qq" implementation "com.com2us.android.hive:hive-authv4-provider-wechat" implementation "com.com2us.android.hive:hive-authv4-provider-huawei" implementation "com.com2us.android.hive:hive-iapv4-market-lebi" }
-
Remove the following library files from the build. If these files are included in the app build, the app may be rejected during the Galaxy Store review process.
- mid-sdk-{VERSION_INFO}.jar
- mta-sdk-{VERSION_INFO}.jar
- open_sdk_{VERSION_INFO}_lite.jar
One store payment setup¶
Set the following in the project level build.gradle.
allprojects {
repositories {
...
// only for OneStore
maven { url 'https://repo.onestore.co.kr/repository/onestore-sdk-public' }
...
}
}
Note
If you are using ONE Store SDK V21, you can distribute your app on the ONE Store Global Platform. For more information, please refer to the ONE Store Global Deployment Guide and Test Option Settings for Global Store Deployment.