RichUtils / pyxis.uzuki.live.richutilskt.module.iap / RInAppBilling

RInAppBilling

class RInAppBilling

Types

ConsumePurchaseResult

interface ConsumePurchaseResult

PurchaseResult

interface PurchaseResult

QueryPurchaseResult

interface QueryPurchaseResult

Security

object Security

Security-related methods. For a secure implementation, all of this code should be implemented on a server that communicates with the application on the device. For the sake of simplicity and clarity of this example, this code is included here and is executed on the device. If you must verify the purchases on the phone, you should obfuscate this code to make it harder for an attacker to replace the code with stubs that treat all purchases as verified.

Constructors

<init>

RInAppBilling(activity: Activity, signatureBase64: String)

Functions

bindInAppBilling

fun bindInAppBilling(): Unit

Should be invoke in onCreate

consumePurchase

fun consumePurchase(transaction: Transaction?, callback: ConsumePurchaseResult): Unit

Consume specific item which consumable item

generateDeveloperPayload

fun generateDeveloperPayload(productId: String, type: String): String

generate developerPayload using nonce(UUID)

getAvailableInappPackage

fun getAvailableInappPackage(items: ArrayList<String>): ArrayList<Sku>

get Available 'inapp' package of own package name.

getPurchase

fun getPurchase(type: String = "inapp", continuationToken: String? = null, callback: QueryPurchaseResult): Unit

query purchased item which not consumed

isValidTransaction

fun isValidTransaction(transaction: Transaction): Boolean

Checking transaction is valid.

onActivityResult

fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Unit

Purchase Result purchaseResult, just pass Activity's onActivityResult.

purchase

fun purchase(productId: String, type: String = "inapp", developerPayload: String = generateDeveloperPayload(productId, type)): Unit

Purchase specific item

setPurchaseResult

fun setPurchaseResult(callback: PurchaseResult): Unit

Using when try to purchase un-consumable item

unBindInAppBilling

fun unBindInAppBilling(): Unit

Should be invoke in onDestroy

Companion Object Properties

PURCHASE_FAILED_INVALID

val PURCHASE_FAILED_INVALID: Int

PURCHASE_FAILED_TO_GET_EMPTY

val PURCHASE_FAILED_TO_GET_EMPTY: Int

PURCHASE_FAILED_UNKNOWN

val PURCHASE_FAILED_UNKNOWN: Int

PURCHASE_SUCCESS

val PURCHASE_SUCCESS: Int