[IOS] Subscribing promoted/introductory subscription
See original GitHub issueVersion of react-native-iap :
4.5.2
Version of react-native :
ejected expo SDK38 0.62.2
Platforms you faced the error :
IOS only
Expected behavior
As already mentioned by closed issue #978 , it is not clearly stated if it is possible or not and how one can activate promoted subscriptions offer (not product, but subscription based offer). Reference : https://developer.apple.com/app-store/subscriptions/#offer-types
_Note for Android : even if the topic is iOS here, for Android, it’s easy to setup on Play Store an intro offer (free trial period), it is well activated with iap without any additional configuration. 👍 _
Actual behavior
When I list subscriptions, I have in the record a discounts
entry including an offer that matches the one I’ve setup in AppStoreConnect : here an annual subscription with 1 month of trial
[ {
productId: 'com.XXX.sdk38.annual',
subscriptionPeriodUnitIOS: 'YEAR',
description: 'Activate Premium features on XXX',
introductoryPrice: '',
title: 'Annual',
introductoryPriceSubscriptionPeriodIOS: '',
introductoryPriceNumberOfPeriodsIOS: '',
discounts:
[ { localizedPrice: '€0,00',
numberOfPeriods: '1',
type: 'SUBSCRIPTION',
identifier: 'com.XXX.sdk38.tryannual',
paymentMode: 'FREETRIAL',
price: '0',
subscriptionPeriod: 'MONTH' } ],
type: 'Do not use this. It returned sub only before',
localizedPrice: '€54,99',
introductoryPricePaymentModeIOS: '',
price: '54.99',
currency: 'EUR',
subscriptionPeriodNumberIOS: '1'
}
If I try to activate the subscription with “com.XXX.sdk38.tryannual”, it tells me that productID does not exists. If I activate with “com.XXX.sdk38.annual”, it buys the subscription but without the trial period. If I setup an introductory offer and activate with “com.XXX.sdk38.annual”, it buys the subscription with the trial period.
Tested environment :
Real device iPhone 6S 13.x, sandbox account
Steps to reproduce the behavior
Ouch ! Maybe it just need a documentation update or clarification 😉
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5
I was having the same issue and for the “withOffer” object you need to get your signed from your backend.
first, you need to follow this steps to get your key and privatekey https://help.apple.com/app-store-connect/#/dev689c93225
and when you get this values, you need to follow this tutorial, is an example with nodejs at the backend
https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/generating_a_subscription_offer_signature_on_the_server
cheers.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.