Skip to content

Lebi

In China, Google Play Store is not available so thatHive platform creates an in-app purchase module, Lebi Store. Users in China, therefore, can purchase items by charging Lebi, the virtual currency. Depending on the types of device, Android-based devices are available to select Google Play Store or Lebi Store. Preparing for user choice, build a payment system paid by Lebi by following the below. Note that iOS does not support Lebi market.

Note

Chinese players using Lebi with Authentication v4 needs to sign in Membership.

Flowchart to Connect with Lebi Store

Store Selecting Screen

If you can provide both the Google Play Store and the Lebi Store, you should call the showMarketSelection() method to display a screen allowing the user to select a store between them, after receiving both the Google Play Store and Lebi Market codes as a result of the marketConnect() method call (the IAP v4 initialization).

  • A sample screen when an Android-based device has two stores available; Google Play Store and Lebi Store

Followings are sample codes to request a screen to select a store.

API Reference: hive .IAPV4.showMarketSelection

using hive;    
    IAPV4.showMarketSelection((ResultAPI result, List<IAPV4Type> typeList) => {    
        if (result.isSuccess()) {    
        // call successful    
        }    
});
#include "HiveIAPV4.h"

FHiveIAPV4::ShowMarketSelection(FIAPV4OnMarketSelectionDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<EHiveIAPV4Type>& MarketIds) {
        if (Result.IsSuccess()) {
                // API call successful
        }
}));

API Reference: IAPV4 ::showMarketSelection

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
    using namespace std;    
    using namespace hive;    
    IAPV4::showMarketSelection([=](ResultAPI const & result, vector<IAPV4Type> const & marketIDs) {    
        if (result.isSuccess()) {    
        // call successful    
        }    
});

API Reference: IAPV4.showMarketSelection

import com.hive.IAPV4    
    import com.hive.ResultAPI    
    IAPV4.showMarketSelection(object : IAPV4.IAPV4MarketInfoListener {    
         override fun onIAPV4MarketInfo(result: ResultAPI, iapV4TypeList: ArrayList<IAPV4.IAPV4Type>?) {    
             if (result.isSuccess) {    
                 // call successful    
             }    
         }    
})

API Reference: IAPV4 .INSTANCE.showMarketSelection

import com.hive.IAPV4;    
    import com.hive.ResultAPI;    

    IAPV4.INSTANCE.showMarketSelection((result, iapV4TypeList) -> {    
         if (result.isSuccess()) {    
             // call successful    
         }    
});

Lebi Balance Search

When user selects Lebi Store, call getBalanceInfo() method of IAPV4 class to request and display the Lebi balance. You can receive the value as balance from getBalanceInfo(). Followings are sample codes to request the balance of Lebi.

API Reference: hive .IAPV4.getBalanceInfo

using hive;    
    IAPV4.getBalanceInfo((ResultAPI result, int balance) => {    
        if (result.isSuccess()) {    
        // call successful    
        }    
});
#include "HiveIAPV4.h"

FHiveIAPV4::GetBalanceInfo(FHiveIAPV4OnBalanceDelegate::CreateLambda([this](const FHiveResultAPI& Result, int32 balance) {
        if (Result.IsSuccess()) {
                // API call successful 
        }
}));

API Reference: IAPV4 ::getBalanceInfo

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
    using namespace std;    
    using namespace hive;    
    IAPV4::getBalanceInfo([=](ResultAPI const & result, int balance) {    
        if (result.isSuccess()) {    
        // call successful    
        }    
});

API Reference: IAPV4.getBalanceInfo

import com.hive.IAPV4    
    import com.hive.ResultAPI    
    IAPV4.getBalanceInfo(object : IAPV4.IAPV4BalanceInfoListener {    
         override fun onIAPV4Balance(result: ResultAPI, balance: Int) {    
             if (result.isSuccess) {    
                 // call successful    
             }    
         }    
})

API Reference: IAPV4 .INSTANCE.getBalanceInfo

import com.hive.IAPV4;    
    import com.hive.ResultAPI;    

    IAPV4.INSTANCE.getBalanceInfo((result, balance) -> {    
         if (result.isSuccess()) {    
             // call successful    
         }    
});

Lebi Charging Screen

When Lebi is lack of its balance, call showCharge() from IAPV4 class to show the charging screen. After charging Lebi, you can check the balance with the variable named balance, from the result of showCharge(). Followings are sample codes to call the page of charging Lebi.

API Reference: hive .IAPV4.showCharge

using hive;    
    IAPV4.showCharge((ResultAPI result, int balance) => {    
    if (result.isSuccess()) {    
    // call successful    
    }    
});
#include "HiveIAPV4.h"

FHiveIAPV4::ShowCharge(FHiveIAPV4OnBalanceDelegate::CreateLambda([this](const FHiveResultAPI& Result, int32 balance) {
        if (Result.IsSuccess()) {
                // API call successful
        }
}));

API Reference: IAPV4 ::showCharge

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
    using namespace std;    
    using namespace hive;    
    IAPV4::showCharge([=](ResultAPI const & result, int balance) {    
         if (result.isSuccess()) {    
             // call successful    
         }    
});

API Reference: IAPV4.showCharge

import com.hive.IAPV4    
    import com.hive.ResultAPI    
    IAPV4.showCharge(object : IAPV4.IAPV4BalanceInfoListener {    
         override fun onIAPV4Balance(result: ResultAPI, balance: Int) {    
             if (result.isSuccess) {    
                 // call successful    
             }    
         }    
})

API Reference: IAPV4 .INSTANCE.showCharge

import com.hive.IAPV4;    
    import com.hive.ResultAPI;    

    IAPV4.INSTANCE.showCharge((result, balance) -> {    
         if (result.isSuccess()) {    
             // call successful    
         }    
});