Changes 🔥
You may find full changelog here.
AdaptyProduct
andAdaptyProductDiscount
now separate ios and android featuresmakePurchase
now supports iOS offersmakePurchase
now supports AndroidsubscriptionUpdateParam
- Promo push notifications support added
setFallbackPaywall
added- Bundle decreased 1.94Mb -> 850kb
- Contribution Guide added
- New Types and IntelliSense docs
updateAttribution
now requiresnetworkUserId
to workAdaptyProductSubscriptionPeriod
now displays unit as textday
,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