IAP v4 initialization
To activate IAP v4, request IAP initialization before purchase. If you request to initialize IAP, Game Client returns available store information. Store information is defined as IAPV4Type
enum, and details in field are as following;
Market information¶
Field Name | Description |
---|---|
APPLE_APPSTORE | Apple App Store |
GOOGLE_PLAYSTORE | Google Play Store |
HIVE_LEBI | Lebi Store |
ONESTORE | ONE Store |
AMAZON_APPSTORE | Amazon App Store (Available with SDK v4 only) |
SAMSUNG_GALAXYSTORE | Samsung Galaxy Store |
HUAWEI_APPGALLERY | Huawei App Gallery |
HIVESTORE | PG Payment (for Windows, Unity only) |
HIVESTORE
(PG Payment) only supports Product Search and Purchase, and the client-based receipt verification is not supported.
Soft currency market in game should be available for users who enjoy the gameplay even after the game stops download service. Therefore, each game studio is required to code hard currency market and soft currency market separately. The result value sent by initializing IAP v4 is not for access to in-game market, so do not use the result value in different ways. Implement marketConnect()
in the IAPV4 class to initialize IAP v4.
Initialize IAPv4¶
Followings are sample codes to initialize IAP v4.
API Reference: hive.IAPV4.marketConnect
API Reference: IAPV4::marketConnect
API Reference: IAPV4.marketConnect
API Reference: com.hive.IAPV4.marketConnect
API Reference: IAPV4Interface .marketConnect
API Reference: HIVEIAPV4::marketConnect
Warning
Failing to call marketConnect()
method enables not to search the product list or purchase the product. This problem occurs for one of the following reasons:
- In case the account login to the terminal is processed abnormally
- In case of abnormal login in marketplaces such as Google Play Store, Apple App Store, and others
- In case of abnormal handling market settings in Hive Console according to an AppID It requires the game client to directly implement the responses for returning failure of Result API, such as retry until getting a success callback or expose an error popup (e.g., market unavailable) to the user. For details of Result API code, see Result API Code - IAP v4.
Notes for initialization¶
From Hive SDK v4 Unity Windows 23.0.0, Windows apps for Google Play are supported, and the GOOGLE\_PLAYSTORE
market can be used. In this case, please note the following during development:
- Initialization (
IAPV4.marketConnect
) must be executed only after the IdP login withAuthV4
. - When
IAPV4.marketConnect
is called for the first time, a Google account login screen for product payment, which allows the app user to select a Google account for payment in the market, will appear. This login process is not a feature that the app developer implements, but is automatically performed by the Hive SDK. - The Google account login for product payments is different from the Google IdP login provided by the Hive SDK authentication module (
AuthV4
). When a user logs out from any IdP (AuthV4
), including Google IdP, the Google account used for product payments will also be automatically logged out.