github adaptyteam/AdaptySDK-React-Native v1.0.0-4
v1.0.0-4: BREAKING

latest releases: v3.0.1, v3.0.0, v2.11.3...
3 years ago

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

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

NewReleases is sending notifications on new releases.