Skip to content

Releases: adaptyteam/AdaptySDK-React-Native

v1.4.0

05 Dec 13:05
Compare
Choose a tag to compare

Breaking πŸ”₯πŸ§‘πŸ»β€πŸš’πŸ”₯

  • You need to run adapty.paywalls.logShow() before calling a purchase method inside a paywall

Features πŸ¦„

  • Stability improved
  • AdaptyError now extends JS Error (#31)
  • adapty.paywalls.logShow() now resolves (#33)
  • Deprecated RN setup dependency.asset removed (#26)
  • iOS library bump: 1.16.8 -> 1.17.7
  • Android library bump: 1.9.0 -> 1.12.0
  • Typescript builds now targets ES5
  • React Native warnings resolved
  • Docs & Readme updated
  • More IntelliSense support (Even more to come in v2.0)
  • More AdaptyErrors are now handled as codes (won't be unknown)
  • New example apps, that would work nicely for your testing purposes: SubscriptionsJS and SubscriptionsExpo
  • Previous example app deprecated

Also installation process for Expo can be found in docs now: https://docs.adapty.io/v1.0/docs/react-native-installation

v1.3.4

21 Dec 10:34
Compare
Choose a tag to compare
  • Added profileId to AdaptyPurchaserInfo

iOS bump 1.16.7 -> 1.16.8
Android bump 1.6.1 -> 1.7.0

v1.3.0

03 Dec 11:04
Compare
Choose a tag to compare
  • Added iOS deferred purchases

v1.2.1

16 Nov 05:27
Compare
Choose a tag to compare
  • Fixes iOS break during build

v1.2.0

15 Nov 13:18
Compare
Choose a tag to compare

Changes ✨

  • πŸ”₯ BREAKING | Android now supports localizedSubscriptionPeriod for AdaptyProduct and AdaptyProductDiscount, Thus, all cases product.ios.localizedSubscriptionPeriod must now be replaced with product.localizedSubscriptionPeriod
  • iOS events now work properly. There are only two left now: onInfoUpdate and onPromoReceived. In both cases TypeScript support was expanded in such a way, that second argument would grab an according callback type (i.e. ('onInfoUpdate', (data: PurchaserInfo) => void | Promise<void>) => Subscription)
  • AdaptyError can now be imported from the root as import { AdaptyError } from 'react-native-adapty'
  • Now you can use"all" logLevel during initialisation
  • Now you can use adapty.promo.canPresentCodeRedemptionSheet(): boolean to verify whether a device is compatible with codeRedemptionSheet

iOS native bump 1.13.2 -> 1.16.4
Android native bump 1.4.0 -> 1.6.0

v1.0.0-4: BREAKING

19 Jul 11:47
Compare
Choose a tag to compare

Changes πŸ”₯

You may find full changelog here.

  • AdaptyProduct and AdaptyProductDiscount now separate ios and android features
  • makePurchase now supports iOS offers
  • makePurchase now supports Android subscriptionUpdateParam
  • Promo push notifications support added
  • setFallbackPaywall added
  • Bundle decreased 1.94Mb -> 850kb
  • Contribution Guide added
  • New Types and IntelliSense docs
  • updateAttribution now requires networkUserId to work
  • AdaptyProductSubscriptionPeriod now displays unit as text day, week etc.
  • TypeScript 4.3 features support
  • AdaptyUser -> AdaptyProfile, same with sdk
  • fixes

Migration guide πŸ§‘β€πŸš’

After updating the library don't forget to update Pods cd ios && pod install (on error pod update Adapty) and re-sync gradle settings for Android

AdaptyProduct

Now OS-based fields are separated. Please check all returns of adapty.purchases.makePurchase() (returns product amongst keys) and adapty.paywalls.getPaywalls() (returns products separately and inside each paywall)

export interface AdaptyProduct {
  vendorProductId: string;
  subscriptionPeriod: AdaptyProductSubscriptionPeriod;
- localizedSubscriptionPeriod: string;
- regionCode: string;
- isFamilyShareable?: boolean;  
- discounts: AdaptyProductDiscount[];
- promotionalOfferEligibility: boolean;
- subscriptionGroupIdentifier: string;
- promotionalOfferId?: string;
- freeTrialPeriod?: AdaptyProductSubscriptionPeriod;

  introductoryDiscount?: AdaptyProductDiscount;
  introductoryOfferEligibility: boolean;
  price: number;
  currencySymbol: string;
  localizedDescription: string;
  localizedTitle: string;
  localizedPrice: string;
  variationId?: string;
  currencyCode: string;
  paywallName?: string;
  paywallABTestName?: string;
+  android?: {
+    freeTrialPeriod?: AdaptyProductSubscriptionPeriod;
+ };
+  ios?: {
+    promotionalOfferEligibility: boolean;
+    isFamilyShareable: boolean;
+    discounts: AdaptyProductDiscount[];
+    promotionalOfferId?: string;
+    subscriptionGroupIdentifier?: string;
+    localizedSubscriptionPeriod?: string;
+    regionCode?: string;
+  };
}

AdaptyProductDiscount

Now OS-based fields are separated. Please check all returns of adapty.purchases.makePurchase() (returns product amongst keys) and adapty.paywalls.getPaywalls() (returns products separately and inside each paywall)

export interface AdaptyProductDiscount {
  subscriptionPeriod: AdaptyProductSubscriptionPeriod;
  price: number;
  localizedPrice: string;
  numberOfPeriods: number;

-  paymentMode: number;
-  identifier: string;
-  localizedSubscriptionPeriod: string;
-  localizedNumberOfPeriods: number;
+  ios?: {
+    localizedNumberOfPeriods: number;
+    localizedSubscriptionPeriod: string;
+    paymentMode: string;
+    identifier: string;
+  };
}

AdaptyProductSubscriptionPeriod

Check if you have .subscriptionPeriod.unit or .freeTrialPeriod.unit, these values are now strings instead of enum and passed as day, week, month, year

makePurchase()

if you have passed offerId as a second argument, now it is done in the other fashion:

adapty.purchases.makePurchase(product: AdaptyProduct, {
  ios?: {offerId?: String},
  android?: {subscriptionUpdateParam?: SubscriptionUpdateParam}
});

updateAttribution()

updateAttribution now requires networkUserId arg. Now interface is this: updateAttribution( networkUserId: string, attribution: Object, source: 'Adjust' | 'AppsFlyer' | 'Branch' | 'Custom' | 'AppleSearchAds')

adapty.user and AdaptyUser to adapty.profile and AdaptyProfile

Check all occurrences of adapty.user and change them to adapty.profile, also adapty.user.updateProfile() is adapty.profile.update() now. If you have imported AdaptyUser, it should be renamed to AdaptyProfile

v0.6.4

15 Apr 14:25
Compare
Choose a tag to compare
  • AdaptyProduct now has isFamilyShareable field for iOS 14+ devices
  • Now you can use adapty.promo.presentCodeRedemptionSheet() to display native iOS offer code view
  • New purchase error-handling

iOS 1.12.4 -> 1.12.7, android 0.8.9 -> 0.9.3

v0.6.3

11 Mar 07:58
Compare
Choose a tag to compare

Features πŸ€Έβ€β™‚οΈ

  • Android: and iOS request gzipping
  • iOS: Added retry for createProfile request in case of poor connection or if a server is down
  • Android: getPaywalls method enhanced

Fixes πŸ‘©β€πŸ”§

  • Android: updateAttribution method could panic
  • iOS: passing facebookAnonymousId to updateProfile could panic
  • default flags for AdaptyProducts were set, thus causing empty fields to be filled with false-positive values

iOS version 1.12.3 -> 1.12.4
Android 0.8.7 -> 0.8.9

v0.6.0

18 Feb 18:47
Compare
Choose a tag to compare

Features πŸ€Έβ€β™‚οΈ

  • Documentation!
  • Added method adapty.setIsExternalAnalyticsEnabled (boolean) lets you enable/disable automatic adapty analytics feature
  • For the method adapty.users.updateProfile({}) facebookAnonymousId can now be passed
  • Added method adapty.purchases.setVariationId() lets you associate transaction with an AdaptyPaywall
  • name and abTestName added to AdaptyPaywall

Fixes πŸ‘©β€πŸ”§

  • β€œundefined” customerUserID when no value is passed
  • Kotlin Boolean conversion could produce true on empty field

iOS version 1.12.1 -> 1.12.3
Android 0.8.4 -> 0.8.7

BREAKING: v0.5

08 Feb 08:57
Compare
Choose a tag to compare

β˜„οΈ BREAKING β˜„οΈ

  • Now methods with caching option like adapty.paywalls.getPaywalls({caching: true}) expect you to use forceUpdate: true flag instead. Default value is false. Example: const info = await adapty.purchases.getInfo({ forceUpdate: true })
  • adapty.purchases.makePurchase(...) now takes product: AdaptyProduct as an argument, that way Adapty ensures that a product includes all special offers from the exact paywall it was requested from
  • adapty.purchases.makePurchase(...) now remembers paywall you've fetched and doesn't need {caching: true} flag any longer. New interface is makePurchase(product: AdaptyProduct)
  • adapty.purshases.validateReceipt was removed

πŸ’« Non-breaking features πŸ’«

  • Errors now provide an extensive information on a problem. All errors thrown by Adapty are now wrapped by AdaptyError class with interface . You can find the full list of adaptyCodes here.
interface AdaptyError {
  // HTTP status code 
  code: number; 
  // certain string values to define the nature of a problem
  adaptyCode: "unknown" | "noProductsFound" | .... ;
  // User-friendly text, which can be displayed as a message
 localizedDescription: string;
}
  • Now you can get and set APNS token via adapty.getApns() and adapty.setApns(value: string) methods
  • Types are now much more exact. Types, that doesn't have both android and iOS representations are now dubbed with @todo NO VALUE ANDROID string within tsdoc
  • adapty.paywalls.getPaywalls() now returns customPayloadString β€” stringed JSON representation of a Custom Payload field
  • adapty.paywalls.logShow(variationId) is now available. Gives a developer full control over paywall analytics

πŸ‘¨β€πŸ”§ Fixes πŸ‘¨β€πŸ”§

  • Within makePurchase method both localizedPrice and price values are passed without mutation (#1)

Adapty Android SDK 0.6.0 -> 0.8.4
Adapty iOS SDK 1.9.1 -> 1.12.1