Support for promotional products / discounts in STOREKIT2_MODE #2881
Unanswered
Stefanie-Twipe
asked this question in
Q&A
Replies: 1 comment
-
|
react-native-iap v14+ fully supports StoreKit 2 promotional offers and discounts. Available FieldsProduct Levelinterface ProductSubscriptionIOS {
// Discount offers array
discountsIOS?: DiscountIOS[];
// Subscription info with offers
subscriptionInfoIOS?: {
introductoryOffer?: SubscriptionOfferIOS;
promotionalOffers?: SubscriptionOfferIOS[];
subscriptionGroupId: string;
subscriptionPeriod: SubscriptionPeriodValueIOS;
};
}Offer Typestype SubscriptionOfferTypeIOS = 'introductory' | 'promotional';
interface SubscriptionOfferIOS {
id?: string;
paymentMode: string;
period: SubscriptionPeriodValueIOS;
periodCount: number;
price: number;
type: SubscriptionOfferTypeIOS;
}Applying a Discount OfferWhen purchasing, use import { requestPurchase } from 'react-native-iap';
await requestPurchase({
request: {
apple: {
sku: 'subscription_id',
withOffer: {
identifier: 'offer_id', // From App Store Connect
keyIdentifier: 'key_id', // Your key ID
nonce: 'unique_nonce', // UUID string
signature: 'signature', // Server-generated signature
timestamp: Date.now(),
},
},
},
type: 'subs',
});Checking Introductory Offer Eligibilityimport { isEligibleForIntroOfferIOS } from 'react-native-iap';
const isEligible = await isEligibleForIntroOfferIOS('subscription_group_id');Note on VersionYou mentioned Please upgrade to v14+ for full StoreKit 2 support: References |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was wondering if somebody could point out to me if there is a way in STOREKIT2_MODE to get promotional offers or discounts like in STOREKIT1_MODE. I found in documentation that they did not found an equivalent in SK2, however I was wondering if somebody here in the community found a way or made a custom path or ...
Basically in STOREKIT1_MODE we had this field
discountsinSubscriptionIOSinterface, that was filled for promoted products or discounts to the product. However this is not available in STOREKIT2_MODE, or at least it is not filled in this mode.We were wondering if this is something that will be added in the future or was taken out by design? Since you are still able to add a promoted product in the App Store Connect, it feels weird that this would not be available anymore in STOREKIT2_MODE anyway.
If anybody can shed some light about this topic, I would really appreciate this!
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions