Android Native - 4.x to 5.x Migration
View the Android SDK Reference documentation here .
If you are looking for the legacy v4.x SDK documentation, you can view that here .
There were various updates to our API in this release, in order to best support the Amazon Store and to maintain parity with our iOS SDK, which recently migrated from ObjC to Swift.
purchases-androidnow requires Java 8
PurchaserInfohas been deprecated and renamed to
CustomerInfo. This rename also affects to all functions that had
PurchaserInfoin their name, like
getPurchaserInfowhich has been renamed to
PurchasesErrorListenerhave been renamed to
Package.producthas been changed from being a
|Old type name||New type name|
Deprecated + New APIs
Configuring the SDK
configure function has been changed to accept a
PurchasesConfiguration.Builder. The previous function is deprecated. The new function can be used like this:
or for Amazon:
purchaseProduct callbacks have been changed to return a
StoreTransaction instead of a
Purchase in the
This means that
MakePurchaseListener has been deprecated in favor of
PurchaseCallback. There is a helper extension function
MakePurchaseListener.toPurchaseCallback() that can help migrate. For purchasing functions that accept an
ProductChangeListener has been deprecated in favor of
Similarly, you can use
MakePurchaseListener.toProductChangeCallback() in Kotlin for an easy migration. Due to the same change, Kotlin helper
purchaseProductWith now accepts a
StoreProduct instead of a
getNonSubscriptionSkus callbacks has been changed to return
StoreProduct objects instead of
This means that
GetSkusResponseListener has been deprecated in favor of
GetStoreProductsCallback. You can use
GetSkusResponseListener.toGetStoreProductsCallback() in Kotlin for an easy migration.
For the same reasons,
getNonSubscriptionSkusWith now receive
storeProducts instead of
Kotlin Helpers Changes
|Old signature||New signature|
Some deprecated functions have been removed:
addAttributionData and the versions of
For more information about recommended identity logic following the removal of these identification methods, see Identifying Users.
- Amazon support (see the section in our docs for more information)
Reporting undocumented issues
Feel free to file an issue! New RevenueCat Issue.
Updated about 1 month ago