There were various updates to our API in this release, in order to best support the Amazon Appstore and to maintain parity with our iOS SDK, which recently migrated from ObjC to Swift.
PurchaserInfo
has been deprecated and renamed toCustomerInfo
. This rename also affects to all functions that hadPurchaserInfo
in their name, likegetPurchaserInfo
which has been renamed togetCustomerInfo
.ReceiveOfferingsListener
andPurchasesErrorListener
have been renamed toReceiveOfferingsCallback
andPurchasesErrorCallback
Package.product
has been changed from being aSkuDetails
toStoreProduct
.
Old type name | New type name |
---|---|
PurchaserInfo |
CustomerInfo |
ReceivePurchaserInfoListener |
ReceiveCustomerInfoCallback |
UpdatedPurchaserInfoListener |
UpdatedCustomerInfoListener |
ReceiveOfferingsListener |
ReceiveOfferingsCallback |
PurchasesErrorListener |
PurchasesErrorCallback |
- The
configure
function has been changed to accept aPurchasesConfiguration.Builder
. The previous function is deprecated. The new function can be used like this:
Purchases.configure(PurchasesConfiguration.Builder(this, "public_google_sdk_key").build())
or for Amazon:
Purchases.configure(AmazonConfiguration.Builder(this, "public_amazon_sdk_key").build())
purchasePackage
andpurchaseProduct
callbacks have been changed to return aStoreTransaction
instead of aPurchase
in theonCompleted
. This means thatMakePurchaseListener
deprecated in favor ofPurchaseCallback
. There is a helper extension functionMakePurchaseListener.toPurchaseCallback()
that can help migrate. For purchasing functions that accept anUpgradeInfo
,ProductChangeListener
has been deprecated in favor ofProductChangeCallback
. Similarly, you can useProductChangeListener.toProductChangeCallback()
andMakePurchaseListener.toProductChangeCallback()
in Kotlin for an easy migration. Due to the same change, Kotlin helperpurchaseProductWith
now accepts aStoreProduct
instead of aSkuDetails
getSubscriptionSkus
andgetNonSubscriptionSkus
callbacks has been changed to returnStoreProduct
objects instead ofSkuDetails
. This means thatGetSkusResponseListener
has been deprecated in favor ofGetStoreProductsCallback
. You can useGetSkusResponseListener.toGetStoreProductsCallback()
in Kotlin for an easy migration. For the same reasons,getSubscriptionSkusWith
andgetNonSubscriptionSkusWith
now receivestoreProducts
instead ofskus
.
Deprecated | New |
---|---|
configure(Context, String, String?, Boolean, ExecutorService) |
configure(PurchasesConfiguration) |
invalidatePurchaserInfoCache() |
invalidateCustomerInfoCache() |
removeUpdatedPurchaserInfoListener() |
removeUpdatedCustomerInfoListener() |
getPurchaserInfo(ReceivePurchaserInfoListener) |
getCustomerInfo(ReceiveCustomerInfoCallback) |
restorePurchases(ReceivePurchaserInfoListener) |
restorePurchases(ReceiveCustomerInfoCallback) |
logOut(ReceivePurchaserInfoListener) |
logOut(ReceiveCustomerInfoCallback) |
purchaseProduct(Activity, SkuDetails, MakePurchaseListener) |
purchaseProduct(Activity, StoreProduct, PurchaseCallback) |
purchaseProduct(Activity, SkuDetails, UpgradeInfo, ProductChangeListener) |
purchaseProduct(Activity, StoreProduct, UpgradeInfo, ProductChangeCallback) |
purchasePackage(Activity, Package, MakePurchaseListener) |
purchasePackage(Activity, Package, PurchaseCallback) |
purchasePackage(Activity, Package, UpgradeInfo, ProductChangeListener) |
purchasePackage(Activity, Package, UpgradeInfo, ProductChangeCallback) |
getSubscriptionSkus(List<String>, GetSkusResponseListener) |
getSubscriptionSkus(List<String>, GetStoreProductsCallback) |
getNonSubscriptionSkus(List<String>, GetSkusResponseListener) |
getNonSubscriptionSkus(List<String>, GetStoreProductsCallback) |
Old signature | New signature |
---|---|
getPurchaserInfoWith((PurchasesError) -> Unit, (PurchaserInfo) -> Unit) |
getCustomerInfoWith((PurchasesError) -> Unit, (CustomerInfo) -> Unit) |
purchasePackageWith(Activity, Package, (PurchasesError) -> Unit, (Purchase, PurchaserInfo) -> Unit) |
purchasePackageWith(Activity, Package, (PurchasesError) -> Unit, (StoreTransaction, CustomerInfo) -> Unit) |
purchasePackageWith(Activity, Package, UpgradeInfo, (PurchasesError) -> Unit, (Purchase, PurchaserInfo) -> Unit) |
purchasePackageWith(Activity, Package, UpgradeInfo, (PurchasesError) -> Unit, (StoreTransaction, CustomerInfo) -> Unit) |
purchaseProductWith(Activity, SkuDetails, (PurchasesError) -> Unit, (Purchase, PurchaserInfo) -> Unit) |
purchaseProductWith(Activity, StoreProduct, (PurchasesError) -> Unit, (StoreTransaction, CustomerInfo) -> Unit) |
purchaseProductWith(Activity, SkuDetails, UpgradeInfo, (PurchasesError) -> Unit, (Purchase, PurchaserInfo) -> Unit) |
purchaseProductWith(Activity, StoreProduct, UpgradeInfo, (PurchasesError) -> Unit, (StoreTransaction, CustomerInfo) -> Unit) |
- Some deprecated functions have been removed:
identify
,reset
,createAlias
,isBillingSupported
,isFeatureSupported
,addAttributionData
and the versions ofpurchaseProduct
/purchasePackage
acceptingUpgradeInfo
andMakePurchaseListener
Removed APIs |
---|
purchaseProduct(Activity, SkuDetails, UpgradeInfo, MakePurchaseListener) |
purchasePackage(Activity, Package, UpgradeInfo, MakePurchaseListener) |
createAlias(String, ReceivePurchaserInfoListener?) |
identify(String, ReceivePurchaserInfoListener?) |
reset(ReceivePurchaserInfoListener?) |
createAliasWith(String, (PurchasesError) -> Unit, (PurchaserInfo) -> Unit) |
identifyWith(String, (PurchasesError) -> Unit, (PurchaserInfo) -> Unit) |
resetWith((PurchasesError) -> Unit, (PurchaserInfo) -> Unit) |
isBillingSupported(Context, Callback<Boolean>) |
isFeatureSupported(BillingClient.FeatureType, Context, Callback<Boolean>) |
addAttributionData(JSONObject, AttributionNetwork, String?) |
addAttributionData(Map<String, Any?>, AttributionNetwork, String?) |
AttributionNetwork |
- Our library now requires Java 8
- Amazon support (see the section in our docs for more information)
Feel free to file an issue! New RevenueCat Issue.