public final class BillingHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEBUG_MESSAGE |
static String |
EXTRA_PARAM_KEY_SKU_DETAILS_TOKEN |
static String |
EXTRA_PARAM_KEY_SUBS_PRICE_CHANGE |
static String |
EXTRA_PARAMS_DEVELOPER_PAYLOAD |
static String |
EXTRA_PARAMS_ENABLE_PENDING_PURCHASES |
static String |
INAPP_CONTINUATION_TOKEN |
static String |
LIBRARY_VERSION_KEY
Field's key to hold library version key constant.
|
static int |
NUMBER_OF_CORES
Total number of cores of current device
|
static String |
RESPONSE_BUY_INTENT_KEY
Key in the response bundle of getBuyIntent for the purchase intent
|
static String |
RESPONSE_CODE |
static String |
RESPONSE_GET_SKU_DETAILS_LIST |
static String |
RESPONSE_INAPP_ITEM_LIST |
static String |
RESPONSE_INAPP_PURCHASE_DATA_LIST |
static String |
RESPONSE_INAPP_SIGNATURE_LIST |
static String |
RESPONSE_SUBS_MANAGEMENT_INTENT_KEY
Key in the response bundle of getSubsManagement for the subs management intent
|
| Constructor and Description |
|---|
BillingHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Bundle |
constructExtraParamsForAcknowledgePurchase(AcknowledgePurchaseParams acknowledgePurchaseParams,
String libraryVersion)
Constructs bundle to provide extra params to
BillingClient.acknowledgePurchase(AcknowledgePurchaseParams,
AcknowledgePurchaseResponseListener) |
static Bundle |
constructExtraParamsForConsume(ConsumeParams consumeParams,
boolean isIabV9Supported,
String libraryVersion)
Constructs bundle to provide extra params to
BillingClient.consumeAsync(ConsumeParams,
ConsumeResponseListener) |
static Bundle |
constructExtraParamsForGetSkuDetails(boolean isIabV9Supported,
boolean enablePendingPurchases,
String libraryVersion)
Constructs bundle to provide extra params to
BillingClient.querySkuDetailsAsync(SkuDetailsParams,
SkuDetailsResponseListener) |
static Bundle |
constructExtraParamsForLaunchBillingFlow(BillingFlowParams params,
boolean isIabV9Supported,
boolean enablePendingPurchases,
String libraryVersion)
Constructs bundle to provide extra params to
BillingClient.launchBillingFlow(Activity, BillingFlowParams) } |
static Bundle |
constructExtraParamsForLoadRewardedSku(String rewardToken,
int childDirected,
int underAgeOfConsent,
String libraryVersion)
Constructs bundle to provide extra params to
com.android.billingclient.api.BillingClient#loadRewardedSku(
RewardLoadParams params, final RewardResponseListener listener) |
static Bundle |
constructExtraParamsForQueryPurchases(boolean isIabV9Supported,
boolean enablePendingPurchases,
String libraryVersion)
Constructs bundle to provide extra params to
BillingClient.queryPurchaseHistoryAsync(String,
PurchaseHistoryResponseListener) and BillingClient.queryPurchases(String) |
static List<Purchase> |
extractPurchases(Bundle bundle)
Gets a purchase data and signature (or lists of them) from the Bundle and returns the
constructed list of
Purchase |
static BillingResult |
getBillingResultFromIntent(Intent intent,
String tag)
Retrieves billingResult from the intent
|
static String |
getDebugMessageFromBundle(Bundle bundle,
String tag)
Retrieves a response code from the bundle
|
static int |
getResponseCodeFromBundle(Bundle bundle,
String tag)
Retrieves a response code from the bundle
|
static int |
getResponseCodeFromIntent(Intent intent,
String tag)
Retrieves a response code from the intent
|
static void |
logVerbose(String tag,
String msg)
Logs a verbose message
|
static void |
logWarn(String tag,
String msg)
Logs a warning message
|
public static final String RESPONSE_CODE
public static final String DEBUG_MESSAGE
public static final String RESPONSE_GET_SKU_DETAILS_LIST
public static final String RESPONSE_BUY_INTENT_KEY
public static final String RESPONSE_SUBS_MANAGEMENT_INTENT_KEY
public static final String RESPONSE_INAPP_ITEM_LIST
public static final String RESPONSE_INAPP_PURCHASE_DATA_LIST
public static final String RESPONSE_INAPP_SIGNATURE_LIST
public static final String INAPP_CONTINUATION_TOKEN
public static final String EXTRA_PARAM_KEY_SUBS_PRICE_CHANGE
public static final String EXTRA_PARAMS_ENABLE_PENDING_PURCHASES
public static final String EXTRA_PARAMS_DEVELOPER_PAYLOAD
public static final String EXTRA_PARAM_KEY_SKU_DETAILS_TOKEN
public static final String LIBRARY_VERSION_KEY
public static int NUMBER_OF_CORES
public static void logVerbose(String tag, String msg)
tag - Tag to be used inside loggingmsg - Message to logpublic static void logWarn(String tag, String msg)
tag - Tag to be used inside loggingmsg - Message to logpublic static int getResponseCodeFromIntent(Intent intent, String tag)
public static BillingResult getBillingResultFromIntent(Intent intent, String tag)
public static int getResponseCodeFromBundle(Bundle bundle, String tag)
public static String getDebugMessageFromBundle(Bundle bundle, String tag)
public static List<Purchase> extractPurchases(Bundle bundle)
Purchasebundle - The bundle to parsepublic static Bundle constructExtraParamsForLaunchBillingFlow(BillingFlowParams params, boolean isIabV9Supported, boolean enablePendingPurchases, String libraryVersion)
BillingClient.launchBillingFlow(Activity, BillingFlowParams) }params - params to initiate a purchase flow.isIabV9Supported - whether InAppBilling version 9 is supported by Play Store.enablePendingPurchases - whether to enable pending purchase in purchase flow.public static Bundle constructExtraParamsForQueryPurchases(boolean isIabV9Supported, boolean enablePendingPurchases, String libraryVersion)
BillingClient.queryPurchaseHistoryAsync(String,
PurchaseHistoryResponseListener) and BillingClient.queryPurchases(String)isIabV9Supported - whether InAppBilling version 9 is supported by Play Store.enablePendingPurchases - whether to receive pending purchases in result.public static Bundle constructExtraParamsForLoadRewardedSku(String rewardToken, int childDirected, int underAgeOfConsent, String libraryVersion)
com.android.billingclient.api.BillingClient#loadRewardedSku(
RewardLoadParams params, final RewardResponseListener listener)public static Bundle constructExtraParamsForGetSkuDetails(boolean isIabV9Supported, boolean enablePendingPurchases, String libraryVersion)
BillingClient.querySkuDetailsAsync(SkuDetailsParams,
SkuDetailsResponseListener)isIabV9Supported - whether InAppBilling version 9 is supported by Play Store.enablePendingPurchases - whether to enable pending purchases in purchase flow.public static Bundle constructExtraParamsForConsume(ConsumeParams consumeParams, boolean isIabV9Supported, String libraryVersion)
BillingClient.consumeAsync(ConsumeParams,
ConsumeResponseListener)consumeParams - params to consume purchaseisIabV9Supported - whether InAppBilling version 9 is supported by Play Store.public static Bundle constructExtraParamsForAcknowledgePurchase(AcknowledgePurchaseParams acknowledgePurchaseParams, String libraryVersion)
BillingClient.acknowledgePurchase(AcknowledgePurchaseParams,
AcknowledgePurchaseResponseListener)acknowledgePurchaseParams - params to initiate acknowledge purchase action.