common / com.revenuecat.purchases.common / Backend

Backend

class Backend

Constructors

<init>

Backend(apiKey: String, dispatcher: Dispatcher, httpClient: HTTPClient)

Properties

callbacks

var callbacks: MutableMap<CallbackCacheKey, MutableList<PurchaserInfoCallback>>

offeringsCallbacks

var offeringsCallbacks: MutableMap<String, MutableList<OfferingsCallback>>

postReceiptCallbacks

var postReceiptCallbacks: MutableMap<CallbackCacheKey, MutableList<PostReceiptCallback>>

Functions

close

fun close(): Unit

createAlias

fun createAlias(appUserID: String, newAppUserID: String, onSuccessHandler: () -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit

getOfferings

fun getOfferings(appUserID: String, appInBackground: Boolean, onSuccess: (JSONObject) -> Unit, onError: (PurchasesError) -> Unit): Unit

getPurchaserInfo

fun getPurchaserInfo(appUserID: String, appInBackground: Boolean, onSuccess: (PurchaserInfo) -> Unit, onError: (PurchasesError) -> Unit): Unit

logIn

fun logIn(appUserID: String, newAppUserID: String, onSuccessHandler: (PurchaserInfo, Boolean) -> Unit, onErrorHandler: (PurchasesError) -> Unit): Unit

performRequest

fun performRequest(path: String, body: Map<String, Any?>?, onError: (PurchasesError) -> Unit, onCompletedSuccessfully: () -> Unit, onCompletedWithErrors: (PurchasesError, Int, JSONObject) -> Unit): Unit

postAttributionData

fun postAttributionData(appUserID: String, network: AttributionNetwork, data: JSONObject, onSuccessHandler: () -> Unit): Unit

postReceiptData

fun postReceiptData(purchaseToken: String, appUserID: String, isRestore: Boolean, observerMode: Boolean, subscriberAttributes: Map<String, Map<String, Any?>>, productInfo: ProductInfo, onSuccess: PostReceiptDataSuccessCallback, onError: PostReceiptDataErrorCallback): Unit