common
Module Contents
alltypes
Module Contents
android.content.Context
class AppConfig
data class AttributionData
enum class AttributionNetwork
class Backend
Module Contents
Backend(apiKey: String, dispatcher: Dispatcher, httpClient: HTTPClient)
var callbacks: MutableMap<CallbackCacheKey, MutableList<PurchaserInfoCallback>>
fun close(): Unit
fun createAlias(appUserID: String, newAppUserID: String, onSuccessHandler: () -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit
fun getOfferings(appUserID: String, appInBackground: Boolean, onSuccess: (JSONObject) -> Unit, onError: (PurchasesError) -> Unit): Unit
fun getPurchaserInfo(appUserID: String, appInBackground: Boolean, onSuccess: (PurchaserInfo) -> Unit, onError: (PurchasesError) -> Unit): Unit
fun logIn(appUserID: String, newAppUserID: String, onSuccessHandler: (PurchaserInfo, Boolean) -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit
var offeringsCallbacks: MutableMap<String, MutableList<OfferingsCallback>>
fun performRequest(path: String, body: Map<String, Any?>?, onError: (PurchasesError) -> Unit, onCompletedSuccessfully: () -> Unit, onCompletedWithErrors: (PurchasesError, Int, JSONObject) -> Unit): Unit
fun postAttributionData(appUserID: String, network: AttributionNetwork, data: JSONObject, onSuccessHandler: () -> Unit): Unit
var postReceiptCallbacks: MutableMap<CallbackCacheKey, MutableList<PostReceiptCallback>>
fun postReceiptData(purchaseToken: String, appUserID: String, isRestore: Boolean, observerMode: Boolean, subscriberAttributes: Map<String, Map<String, Any?>>, productInfo: ProductInfo, onSuccess: PostReceiptDataSuccessCallback, onError: PostReceiptDataErrorCallback): Unit
enum class BackendErrorCode
class BillingWrapper : PurchasesUpdatedListener, BillingClientStateListener
Module Contents
BillingWrapper(clientFactory: ClientFactory, mainHandler: Handler)
fun acknowledge(token: String, onAcknowledged: (billingResult: BillingResult, purchaseToken: String) -> Unit): Unit
var billingClient: BillingClient?
class ClientFactory
fun consumePurchase(token: String, onConsumed: (billingResult: BillingResult, purchaseToken: String) -> Unit): Unit
fun findPurchaseInPurchaseHistory(skuType: String, sku: String, completion: (BillingResult, PurchaseHistoryRecordWrapper?) -> Unit): Unit
fun isConnected(): Boolean
fun makePurchaseAsync(activity: Activity, appUserID: String, skuDetails: SkuDetails, replaceSkuInfo: ReplaceSkuInfo?, presentedOfferingIdentifier: String?): Unit
fun onBillingServiceDisconnected(): Unit
fun onBillingSetupFinished(billingResult: BillingResult): Unit
fun onPurchasesUpdated(billingResult: BillingResult, purchases: List<Purchase>?): Unit
var purchasesUpdatedListener: PurchasesUpdatedListener?
interface PurchasesUpdatedListener
fun queryAllPurchases(onReceivePurchaseHistory: (List<PurchaseHistoryRecordWrapper>) -> Unit, onReceivePurchaseHistoryError: (PurchasesError) -> Unit): Unit
fun queryPurchaseHistoryAsync(skuType: String, onReceivePurchaseHistory: (List<PurchaseHistoryRecord>) -> Unit, onReceivePurchaseHistoryError: (PurchasesError) -> Unit): Unit
fun queryPurchases(skuType: String): QueryPurchasesResult?
data class QueryPurchasesResult
fun querySkuDetailsAsync(itemType: String, skuList: List<String>, onReceiveSkuDetails: (List<SkuDetails>) -> Unit, onError: (PurchasesError) -> Unit): Unit
var stateListener: StateListener?
interface StateListener
com.android.billingclient.api.BillingResult
com.android.billingclient.api.Purchase
com.android.billingclient.api.PurchaseHistoryRecord
com.android.billingclient.api.SkuDetails
object Config
interface DateProvider
class DefaultDateProvider : DateProvider
class DeviceCache
Module Contents
DeviceCache(preferences: SharedPreferences, apiKey: String, offeringsCachedObject: InMemoryCachedObject<Offerings> = InMemoryCachedObject(), dateProvider: DateProvider = DefaultDateProvider())
@Synchronized fun addSuccessfullyPostedToken(token: String): Unit
val appUserIDCacheKey: String
val attributionCacheKey: String
@Synchronized fun cacheAppUserID(appUserID: String): Unit
@Synchronized fun cacheAttributionData(network: AttributionNetwork, userId: String, cacheValue: String): Unit
val cachedOfferings: Offerings?
@Synchronized fun cacheOfferings(offerings: Offerings): Unit
@Synchronized fun cachePurchaserInfo(appUserID: String, info: PurchaserInfo): Unit
@Synchronized fun cleanPreviouslySentTokens(activeSubsHashedTokens: Set<String>, unconsumedInAppsHashedTokens: Set<String>): Unit
@Synchronized fun clearCachesForAppUserID(appUserID: String): Unit
@Synchronized fun clearLatestAttributionData(userId: String): Unit
@Synchronized fun clearOfferingsCacheTimestamp(): Unit
@Synchronized fun clearPurchaserInfoCache(appUserID: String): Unit
@Synchronized fun clearPurchaserInfoCacheTimestamp(appUserID: String): Unit
fun findKeysThatStartWith(cacheKey: String): Set<String>
@Synchronized fun getActivePurchasesNotInCache(activeSubsByTheirHashedToken: Map<String, PurchaseWrapper>, activeInAppsByTheirHashedToken: Map<String, PurchaseWrapper>): List<PurchaseWrapper>
@Synchronized fun getCachedAppUserID(): String?
@Synchronized fun getCachedAttributionData(network: AttributionNetwork, userId: String): String?
fun getCachedPurchaserInfo(appUserID: String): PurchaserInfo?
fun getJSONObjectOrNull(key: String): JSONObject?
@Synchronized fun getLegacyCachedAppUserID(): String?
@Synchronized fun getPreviouslySentHashedTokens(): Set<String>
@Synchronized fun getPurchaserInfoCachesLastUpdated(appUserID: String): Date?
@Synchronized fun isOfferingsCacheStale(appInBackground: Boolean): Boolean
@Synchronized fun isPurchaserInfoCacheStale(appUserID: String, appInBackground: Boolean): Boolean
val legacyAppUserIDCacheKey: String
fun newKey(key: String): String
fun purchaserInfoCacheKey(appUserID: String): String
fun purchaserInfoLastUpdatedCacheKey(appUserID: String): String
fun putString(cacheKey: String, value: String): Unit
fun remove(cacheKey: String): Unit
@Synchronized fun setOfferingsCacheTimestampToNow(): Unit
@Synchronized fun setPurchaserInfoCacheTimestamp(appUserID: String, date: Date): Unit
@Synchronized fun setPurchaserInfoCacheTimestampToNow(appUserID: String): Unit
val subscriberAttributesCacheKey: String
val tokensCacheKey: String
open class Dispatcher
class HTTPClient
class InMemoryCachedObject<T>
java.lang.Exception
Module Contents
fun Exception.toPurchasesError(): PurchasesError
java.util.Locale
kotlin.Int
Module Contents
fun Int.billingResponseToPurchasesError(underlyingErrorMessage: String): PurchasesError
fun Int.getBillingResponseCodeName(): String
kotlin.String
enum class LogIntent
org.json.JSONObject
data class PlatformInfo
class ProductInfo
data class PurchaseHistoryRecordWrapper
enum class PurchaseType
data class PurchaseWrapper
data class ReplaceSkuInfo
data class SubscriberAttributeError
package com.revenuecat.purchases.common
Module Contents
android.content.Context
class AppConfig
const val ATTRIBUTE_ERRORS_KEY: String
const val ATTRIBUTES_ERROR_RESPONSE_KEY: String
class Backend
Module Contents
Backend(apiKey: String, dispatcher: Dispatcher, httpClient: HTTPClient)
var callbacks: MutableMap<CallbackCacheKey, MutableList<PurchaserInfoCallback>>
fun close(): Unit
fun createAlias(appUserID: String, newAppUserID: String, onSuccessHandler: () -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit
fun getOfferings(appUserID: String, appInBackground: Boolean, onSuccess: (JSONObject) -> Unit, onError: (PurchasesError) -> Unit): Unit
fun getPurchaserInfo(appUserID: String, appInBackground: Boolean, onSuccess: (PurchaserInfo) -> Unit, onError: (PurchasesError) -> Unit): Unit
fun logIn(appUserID: String, newAppUserID: String, onSuccessHandler: (PurchaserInfo, Boolean) -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit
var offeringsCallbacks: MutableMap<String, MutableList<OfferingsCallback>>
fun performRequest(path: String, body: Map<String, Any?>?, onError: (PurchasesError) -> Unit, onCompletedSuccessfully: () -> Unit, onCompletedWithErrors: (PurchasesError, Int, JSONObject) -> Unit): Unit
fun postAttributionData(appUserID: String, network: AttributionNetwork, data: JSONObject, onSuccessHandler: () -> Unit): Unit
var postReceiptCallbacks: MutableMap<CallbackCacheKey, MutableList<PostReceiptCallback>>
fun postReceiptData(purchaseToken: String, appUserID: String, isRestore: Boolean, observerMode: Boolean, subscriberAttributes: Map<String, Map<String, Any?>>, productInfo: ProductInfo, onSuccess: PostReceiptDataSuccessCallback, onError: PostReceiptDataErrorCallback): Unit
enum class BackendErrorCode
class BillingWrapper : PurchasesUpdatedListener, BillingClientStateListener
Module Contents
BillingWrapper(clientFactory: ClientFactory, mainHandler: Handler)
fun acknowledge(token: String, onAcknowledged: (billingResult: BillingResult, purchaseToken: String) -> Unit): Unit
var billingClient: BillingClient?
class ClientFactory
fun consumePurchase(token: String, onConsumed: (billingResult: BillingResult, purchaseToken: String) -> Unit): Unit
fun findPurchaseInPurchaseHistory(skuType: String, sku: String, completion: (BillingResult, PurchaseHistoryRecordWrapper?) -> Unit): Unit
fun isConnected(): Boolean
fun makePurchaseAsync(activity: Activity, appUserID: String, skuDetails: SkuDetails, replaceSkuInfo: ReplaceSkuInfo?, presentedOfferingIdentifier: String?): Unit
fun onBillingServiceDisconnected(): Unit
fun onBillingSetupFinished(billingResult: BillingResult): Unit
fun onPurchasesUpdated(billingResult: BillingResult, purchases: List<Purchase>?): Unit
var purchasesUpdatedListener: PurchasesUpdatedListener?
interface PurchasesUpdatedListener
fun queryAllPurchases(onReceivePurchaseHistory: (List<PurchaseHistoryRecordWrapper>) -> Unit, onReceivePurchaseHistoryError: (PurchasesError) -> Unit): Unit
fun queryPurchaseHistoryAsync(skuType: String, onReceivePurchaseHistory: (List<PurchaseHistoryRecord>) -> Unit, onReceivePurchaseHistoryError: (PurchasesError) -> Unit): Unit
fun queryPurchases(skuType: String): QueryPurchasesResult?
data class QueryPurchasesResult
fun querySkuDetailsAsync(itemType: String, skuList: List<String>, onReceiveSkuDetails: (List<SkuDetails>) -> Unit, onError: (PurchasesError) -> Unit): Unit
var stateListener: StateListener?
interface StateListener
com.android.billingclient.api.BillingResult
com.android.billingclient.api.Purchase
com.android.billingclient.api.PurchaseHistoryRecord
com.android.billingclient.api.SkuDetails
object Config
interface DateProvider
fun debugLog(message: String): Unit
class DefaultDateProvider : DateProvider
open class Dispatcher
fun errorLog(message: String): Unit
fun errorLog(error: PurchasesError): Unit
const val HTTP_NOT_FOUND_ERROR_CODE: Int
const val HTTP_SERVER_ERROR_CODE: Int
class HTTPClient
fun infoLog(message: String): Unit
java.lang.Exception
Module Contents
fun Exception.toPurchasesError(): PurchasesError
java.util.Locale
kotlin.Int
Module Contents
fun Int.billingResponseToPurchasesError(underlyingErrorMessage: String): PurchasesError
fun Int.getBillingResponseCodeName(): String
kotlin.String
fun log(intent: LogIntent, message: String): Unit
enum class LogIntent
org.json.JSONObject
data class PlatformInfo
class ProductInfo
data class PurchaseHistoryRecordWrapper
enum class PurchaseType
data class PurchaseWrapper
data class ReplaceSkuInfo
data class SubscriberAttributeError
fun BackendErrorCode.toPurchasesError(underlyingErrorMessage: String): PurchasesError
fun Result.toPurchasesError(): PurchasesError
fun BackendErrorCode.toPurchasesErrorCode(): PurchasesErrorCode
fun PurchaseType.toSKUType(): String?
fun warnLog(message: String): Unit
package com.revenuecat.purchases.common.attribution
package com.revenuecat.purchases.common.caching
Module Contents
class DeviceCache
Module Contents
DeviceCache(preferences: SharedPreferences, apiKey: String, offeringsCachedObject: InMemoryCachedObject<Offerings> = InMemoryCachedObject(), dateProvider: DateProvider = DefaultDateProvider())
@Synchronized fun addSuccessfullyPostedToken(token: String): Unit
val appUserIDCacheKey: String
val attributionCacheKey: String
@Synchronized fun cacheAppUserID(appUserID: String): Unit
@Synchronized fun cacheAttributionData(network: AttributionNetwork, userId: String, cacheValue: String): Unit
val cachedOfferings: Offerings?
@Synchronized fun cacheOfferings(offerings: Offerings): Unit
@Synchronized fun cachePurchaserInfo(appUserID: String, info: PurchaserInfo): Unit
@Synchronized fun cleanPreviouslySentTokens(activeSubsHashedTokens: Set<String>, unconsumedInAppsHashedTokens: Set<String>): Unit
@Synchronized fun clearCachesForAppUserID(appUserID: String): Unit
@Synchronized fun clearLatestAttributionData(userId: String): Unit
@Synchronized fun clearOfferingsCacheTimestamp(): Unit
@Synchronized fun clearPurchaserInfoCache(appUserID: String): Unit
@Synchronized fun clearPurchaserInfoCacheTimestamp(appUserID: String): Unit
fun findKeysThatStartWith(cacheKey: String): Set<String>
@Synchronized fun getActivePurchasesNotInCache(activeSubsByTheirHashedToken: Map<String, PurchaseWrapper>, activeInAppsByTheirHashedToken: Map<String, PurchaseWrapper>): List<PurchaseWrapper>
@Synchronized fun getCachedAppUserID(): String?
@Synchronized fun getCachedAttributionData(network: AttributionNetwork, userId: String): String?
fun getCachedPurchaserInfo(appUserID: String): PurchaserInfo?
fun getJSONObjectOrNull(key: String): JSONObject?
@Synchronized fun getLegacyCachedAppUserID(): String?
@Synchronized fun getPreviouslySentHashedTokens(): Set<String>
@Synchronized fun getPurchaserInfoCachesLastUpdated(appUserID: String): Date?
@Synchronized fun isOfferingsCacheStale(appInBackground: Boolean): Boolean
@Synchronized fun isPurchaserInfoCacheStale(appUserID: String, appInBackground: Boolean): Boolean
val legacyAppUserIDCacheKey: String
fun newKey(key: String): String
fun purchaserInfoCacheKey(appUserID: String): String
fun purchaserInfoLastUpdatedCacheKey(appUserID: String): String
fun putString(cacheKey: String, value: String): Unit
fun remove(cacheKey: String): Unit
@Synchronized fun setOfferingsCacheTimestampToNow(): Unit
@Synchronized fun setPurchaserInfoCacheTimestamp(appUserID: String, date: Date): Unit
@Synchronized fun setPurchaserInfoCacheTimestampToNow(appUserID: String): Unit
val subscriberAttributesCacheKey: String
val tokensCacheKey: String
class InMemoryCachedObject<T>