Searching Product List

Call the Product List Search API when user enters the in-app store. If user requests a product list, return the IAPV4Product class with the product information.

Product List and Details

Field Name Description
marketPid Inherent product ID registered at in-app store
currency Currency type (e.g. KRW/USD)
price Product price
title Product title
displayPrice String type of product price (e.g. $100.00) More
productDescription Product details
originalMarketJson the product information received from the market
When using Google subscription V2, the product information defined in Google Play Console can be checked with originalMarketJson
displayOriginalPrice Price string before discount
originalPrice Original price without discount
iconURL Product icon (512*512)
Available with Hive SDK v4.12.0 and later, for Google only
displayPrice
  • Send displayPrice with the combination of currency sign and price in order (e.g. $0.99). As Android or iOS has its own display type, the order of currency sign and price may show up differently in several countries depending on the OS.
  • Make sure to output the currency sign of each country as the same with its table. Refer to the Hive Identifier Policy to confirm the table of currency sign.
  • In case of additional countries to add or change VAT, server calculates VAT of all currency and adds to displayPrice, price, displayOriginalPrice andoriginalPrice. Therefore, you have no more work relevant to VAT.

To search the product list, call getProductInfo() method in the IAPV4 class to receive the product information of the list and Lebi balance.
Followings are sample codes to request a search for product list.

Unity®

API Reference: hive .IAPV4.getProductInfo

C++

API Reference: IAPV4 ::getProductInfo

Kotlin

API Reference: IAPV4.getProductInfo

Java

API Reference: com .hive.IAPV4.getProductInfo

Swift

API Reference: IAPV4Interface .getProductInfo

Objective-C

API Reference: HIVEIAPV4::getProductInfo

Product Purchase

Call purchase() method in the IAPV4 class with Market PID, a parameter registered on Apple App Store and Google Play Store, to request product purchase on Hive IAP v4.
Followings are sample codes to request product purchase.

Unity®

API Reference: hive .IAPV4.purchase

C++

API Reference: IAPV4 ::purchase

Kotlin

API Reference: com.hive.IAPV4.purchase

Java

API Reference: com .hive.IAPV4.purchase

Swift

API Reference: HIVEIAPV4::purchase:additionalInfo:handler:

Objective-C

Use iapPayload

When executing the purchase (purchase()) or subscription (purchaseSubscription) method, game companies can pass iapPayload as an argument. iapPayload is purchase metadata defined by the game company. For example, when a user purchases a product, it may include the purchase time, purchase user information, purchased game character information, purchased quantity (consumable item), purchase token, etc.

If iapPayload is passed as an argument, the Hive IAP server will verify the purchase receipt, matches this iapPayload value to which the purchase receipt it corresponds to and informs the game server. Specifically, the iapPayload value and the hiveiap_transaction_id value corresponding to the unique receipt key are matched and transmitted to the game server.

Utilizing the purchase receipt and iapPayload pair can solve many problems. For example, there may be a situation where an error occurred when a user purchased an item, and the payment was completed but the item was not delivered. At this time, if restore() method is executed, you can get the purchase receipt for that item. But, as this receipt does not contain information about what type of the item, what time the item was purchased, and what character purchased this item, so it is difficult to know exactly which item the game company should restore for the user. However, this information can be known through the iapPayload paired with the purchase receipt, so that the user can be provided with the item.

Set purchase quantity of consumable items

The Google Play Store allows users to purchase two or more of the same in-app products in a single transaction by specifying the quantity in the shopping cart. If your Google Play Console product settings allow multi-quantity purchases, your app should handle multi-quantity purchases and deliver items based on the specified purchase quantity. However, multi-quantity purchases are for consumable in-app products, which are the products that can be purchased again after consumption. Do not enable this feature for the products that cannot be purchased repeatedly.

Precautions before Calling purchase() Method

  • If RESPONSE_FAIL or CANCELED error is sent while calling purchase() method due to market issues, notify the problems to users that purchase process occurs errors.
  • If users are notified of the purchase problems due to market issues, call restore() method to restore the purchase.
  • If NEED_RESTORE error is sent while calling purchase() method, purchase is cancelled. To restore the purchase, call restore() method.
  • In case the billing system attempts to pay offline or a child asks his or her parents to pay on behalf of him/her while calling purchase() method, ITEM_PENDING error is sent and the item becomes pending state. The proxy purchase of the parents is supported for the Google Play Store, Amazon and Apple App Store market.
  • If succeeded in offline payment or parents’ payment instead of their child is made, IAP_UPDATED event is sent through UserEngagement.
    When the parameter is returned via the UserEngagement eventEnd callback, call restoreSubscription() if the type is “subscription,” or call restore() if the type is empty. The completed receipt is available to check by calling these methods.
  • To troubleshoot the NOT_SUPPORTED error which notifies unavailable purchase, refer to the Guide for Phrases to Restrict In-app Purchase.
  • When purchasing through HIVESTORE in a desktop environment, the payment request screen is displayed in a new window.

    Calling hive.IAPV4.purchase(marketPid, null, onIAPV4PurchaseCB); will immediately return a response with ErrorCode:IAPSUCCESS=90 and Code:IAPV4HiveStoreSuccess=-6110000 without receipt information, through onIAPV4PurchaseCB. Based on the ErrorCode (or Code), it is possible to display a guidance message about the state of item distribution eligibility.
  • For Windows apps on Google Play (Hive SDK v4 Unity Windows 23.0.0 or higher) using the GOOGLE_PLAYSTORE market, if the authentication information of the Google account used for payment expires, Hive SDK automatically executes the re-authentication process.
  • For Windows apps on Google Play (Hive SDK v4 Unity Windows 23.0.0 or higher) using the GOOGLE_PLAYSTORE market, when a user presses the confirm button on the payment waiting popup displayed in the app, and the completion of payment is unconfirmed, a response with ErrorCode:IAPSUCCESS=90 and Code:IAPV4PendingPurchase=-6100013 is returned via onIAPV4PurchaseCB. This response does not indicate a failed payment, but rather that the completion of payment could not be confirmed due to an internal error, or the user just did not make a payment. In this case, no receipt is returned, and if the user has completed the payment in the payment browser window, the receipt can be obtained through IAPV4.restore.

Purchase Error Codes

Error Code Description
NEED_INITIALIZE Unable to initialize
NETWORK Network error
NOT_SUPPORTED Unable to purchase (In-app purchase denied on device, etc.). User sets unavailable store
INVALID_SESSION Invalid session to purchase
INVALID_PARAM Invalid parameter
IN_PROGRESS Purchase API in progress
ITEM_PENDING Prompt to pay offline or a child requested his or her parents to pay on be half of him/her
CANCELED User cancelled
NEED_RESTORE Need Restore API
RESPONSE_FAIL Hive IAP Server error

Phrases to Restrict In-app Purchase

Korean 앱 내 구입 기능이 차단이 되어 구매가 불가합니다.
해제 후 다시 시도해 주세요.
(설정 > 스크린 타임 > 콘텐츠 및 개인 정보 보호 제한 > iTunes 및 App Store 구입 > 앱 내 구입)
English You can’t make a purchase because the in-app purchase feature has been blocked.
Please unblock the feature and try again.
(Settings > Screen Time > Content & Privacy Restrictions > iTunes & App Store Purchases > In-app Purchases)
French u ne peux pas effectuer l’achat car la fonction d’achat in-app a été bloquée.
Débloque d’abord la fonction et essaie de nouveau.
(Réglages > Temps d’écran > Restrictions relatives au contenu et à la confidentialité > Achats dans l’iTunes et l’App Store > Achats intégrés)
German Kauf nicht möglich, weil das In-App-Kauf-Feature gesperrt ist.
Bitte entsperre es und versuche es erneut.
(Einstellungen > Bildschirmzeit > Beschränkungen > Käufe im iTunes & App Store > In-App-Käufe)
Japanese App内の購入機能が制限されており、購入できません。
解除した後、再度お試しください。
(設定 > スクリーンタイム > コンテンツとプライバシーの制限 > iTunesおよびApp Storeでの購入 > App内課金)
Chinese Simplified 因App内购功能已关闭,无法进行购买。
请开启后再试。
(设置 > 屏幕使用时间 > 内容和隐私访问限制 > iTunes Store 与 App Store 购买项目 > App 内购买项目)
Chinese Traditional 因App內購功能已關閉, 無法進行購買.
請開啟後重新再試
(設定 > 螢幕使用時間 > 內容與隱私權限制 > iTunes 與 App Store 購買 > App 內購買)
Russian Покупка недоступна, т.к. на устройстве отключены встроенные покупки.
Активируйте данную функцию и повторите попытку.
(Настройки > Экранное время > Контент и конфиденциальность > Покупки в iTunes Store и App Store > Встроенные покупки)
Spanish No se puede realizar la compra porque la función de Compras en la app ha sido bloqueada.
Favor de desbloquear la función y volver a intentar.
(Ajustes > Tiempo de uso > Restricciones de contenido y privacidad > Compras en iTunes y App Store > Compras dentro de la app)
Portuguese Você não pode efetuar uma compra porque a função de compra do app foi bloqueada.
Por favor, desbloqueie a função e tente novamente.
(Definições > Tempo de ecrã > Conteúdo e privacidade > Compras na iTunes e App Store > Compras integradas)
Indonesian Pembelian tidak bisa dilakukan karena fitur pembelian In-App telah dibatasi.
Silakan matikan pembatasan dan coba lagi.
(Pengaturan > Durasi Layar > Pembatasan Konten & Privasi > Pembelian iTunes & App Store > Pembelian In-app)
Turkish Uygulama içi satın alma özelliği bloke edildiği için satın almayı yapamazsınız.
Lütfen özelliğin blokajını kaldırıp tekrar deneyiniz.
(Ayarlar > Ekran Süresi > İçerik ve Gizlilik Sınırlamaları > iTunes ve App Store Satın Alımları > Uygulama İçi Satın Alım)
Vietnamese Bạn không thể thực hiện giao dịch do tính năng Mua In-App đang bị tắt.
Vui lòng bật tính năng và thử lại.
(Cài đặt > Thời gian sử dụng > Bật giới hạn > Mua hàng iTunes & App Store > Mua In-app)
Thai คุณไม่สามารถซื้อได้เนื่องจากเมนูการซื้อของในแอพพลิเคชั่นถูกบล็อคอยู่
กรุณาปลดล็อคแล้วลองอีกครั้ง
(การตั้งค่า > เวลาหน้าจอ > จำกัดเนื้อหาและความเป็นส่วนตัว > สินค้าที่ซื้อใน iTunes & App Store > การซื้อภายในแอพ)
Italian Non puoi effettuare l’acquisto perché la funzione di acquisti in-app è bloccata.
Preghiamo di sbloccare la funzione e riprovare.
(Impostazioni > Tempo di utilizzo > Contenuti e privacy > Acquisti su iTunes e App Store > Acquisti in-app)
Arabic .لا يمكنك إجراء عملية شراء لأن ميزة الشراء داخل التطبيق قد تم حظرها
.الرجاء إلغاء حظر الميزة والمحاولة مرة أخرى
(الإعدادات > مدة استخدام الجهاز > قيود المحتوى والخصوصية > الشراء من iTunes Store و App Store > الشراء من داخل التطبيق)

Phrases to notify purchase withdrawal policy

In accordance with the Content Industry Promotion Act, please expose the notices about withdrawal of purchase and a link to your purchase withdrawal policy on your game stores. For iOS, if the notices about purchase withdrawal were exposed during Apple‘s inspection process on your app, it could be a reason for the rejection of reviewing your game.