Meet the second version of the Adapty SDK 🎉
See our what's new and migration guide for API updates.
Why not 2.0.0
Since SDK v2 Adapty has decided to sync vX.X._
versioning across platforms. The reason for that is because all cross-platform solutions (like React Native) are made as native SDK proxies. If iOS native SDK v2.2.0 adds integration with Firebase and Google Analytics, then next React Native version would most likely add the same feature by bridging the new native code to JS.
It used to be a hassle on v1! We needed to remember, what native versions React Native implemented on version v1.x.x
. It well could be that RN v1.2.1
implemented iOS v1.4.6
and Android v1.3.12
. Navigating in those is a pure nightmare! Now first two numbers will guarantee a set of features. If native iOS v2.2.x
has something, then native android v2.2.x
and React Native v2.2.x
also must have the same feature set. This syncing also would provide a huge relief on structuring our documentation and our support team.
Updates
The SDK has been effectively rewritten, hence it is meaningless to write changes. We strongly advise you to check migration guide or a new API reference.
Migration guide does not list all the changes, you may scroll through v2 documentation for more details.
Features
- Instead of getting all paywalls in one request with the
.getPaywalls()
, it must be done separately for each paywall using.getPaywall("<paywallId>")
- Added integration with Firebase and Google Analytics. Read more.
- Added
apiKey
check on activate (there will be full reset if you change your apiKey without app reinstall) - Added integration with OneSignal. Read more.
- Added integration with Pushwoosh. Read more.
- The forceUpdate parameter was removed from the getPaywall method. The result will always be up to date if it is possible to retrieve data from the server
- Experimental
waitUntilActive
mutex - It is no longer possible to use products outside of the paywall. If you need to handle a product, create a separate paywall for it (or for multiple products)
AdaptyError
more informative logging. Error code list filtered- Type-safe bridging interfaces
introductoryOfferEligibility
– instead of true/false we give a more extended list of optionsAdaptyErrror.prefix
that prepends a string to all error logsAdaptyError.onError
that pipes all errors to one place- JS objects, that work as TypeScript string unions for purists
Renames
Methods
activateAdapty
→adapty.activate
adapty.profile.identify
→adapty.identify
adapty.purchases.getInfo
→adapty.getProfile
adapty.profile.update
→adapty.updateProfile
adapty.profile.logout
→adapty.logout
adapty.paywalls.logShow
→adapty.logShowPaywall
adapty.paywalls.setFallback
→adapty.setFallbackPaywalls
adapty.purchases.makePurchase
→adapty.makePurchase
adapty.purchases.setVariationId
→adapty.setVariationId
adapty.purchases.restore
→adapty.restorePurchases
adapty.promo.presentCodeRedemptionSheet
→adapty.presentCodeRedemptionSheet
Types
AdaptyPurchaserInfo
→AdaptyProfile
AdaptyProfile
→AdaptyProfileParameters
AdaptyPaidAccessLevelsInfo
→AdaptyAccessLevel
AdaptyNonSubscriptionsInfo
→AdaptyNonSubscription
AdaptySubscriptionsInfo
→AdaptySubscription
AdaptyOfferType
→OfferType
AdaptyVendorStore
→VendorStore
AdaptyProductSubscriptionPeriod
→AdaptySubscriptionPeriod
Events
onInfoUpdate
→onLatestProfileLoad
Added API
adapty.setLogLevel
to change log level in runtimeadapty.getPaywall
is now instead ofgetPaywalls
adapty.getPaywallProducts
fetches a list of products for a provided paywalladapty.logShowOnboarding
a separate API for onboarding screens
Removed API
Methods
adapty.paywalls.getPaywalls
is replaced withadapty.getPaywall
adapty.promo.canPresentCodeRedemptionSheet
adapty.promo.getPromo
adapty.getApnsToken
adapty.setApnsToken
Events
onPromoReceived
Under the hood
- The bridge layer was rewritten from scratch
- The server interaction layer was rewritten from scratch
- The initial request sequence has been optimized and simplified
- Reduced the number of API calls made by SDK. Some of the request are now faster and transfer less data
- Independent requests can be executed simultaneously
- StoreKit interaction layer was refactored
Full documentation can be found in here.