github adaptyteam/AdaptySDK-React-Native v2.2.0

latest releases: v2.11.3, v2.11.2, v2.11.1...
20 months ago

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 options
  • AdaptyErrror.prefix that prepends a string to all error logs
  • AdaptyError.onError that pipes all errors to one place
  • JS objects, that work as TypeScript string unions for purists

Renames

Methods

  • activateAdaptyadapty.activate
  • adapty.profile.identifyadapty.identify
  • adapty.purchases.getInfoadapty.getProfile
  • adapty.profile.updateadapty.updateProfile
  • adapty.profile.logoutadapty.logout
  • adapty.paywalls.logShowadapty.logShowPaywall
  • adapty.paywalls.setFallbackadapty.setFallbackPaywalls
  • adapty.purchases.makePurchaseadapty.makePurchase
  • adapty.purchases.setVariationIdadapty.setVariationId
  • adapty.purchases.restoreadapty.restorePurchases
  • adapty.promo.presentCodeRedemptionSheetadapty.presentCodeRedemptionSheet

Types

  • AdaptyPurchaserInfoAdaptyProfile
  • AdaptyProfileAdaptyProfileParameters
  • AdaptyPaidAccessLevelsInfoAdaptyAccessLevel
  • AdaptyNonSubscriptionsInfoAdaptyNonSubscription
  • AdaptySubscriptionsInfoAdaptySubscription
  • AdaptyOfferTypeOfferType
  • AdaptyVendorStoreVendorStore
  • AdaptyProductSubscriptionPeriodAdaptySubscriptionPeriod

Events

  • onInfoUpdateonLatestProfileLoad

Added API

  • adapty.setLogLevel to change log level in runtime
  • adapty.getPaywall is now instead of getPaywalls
  • adapty.getPaywallProducts fetches a list of products for a provided paywall
  • adapty.logShowOnboarding a separate API for onboarding screens

Removed API

Methods

  • adapty.paywalls.getPaywalls is replaced with adapty.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.

Don't miss a new AdaptySDK-React-Native release

NewReleases is sending notifications on new releases.