Closed lc3t35 closed 3 years ago
Was wondering the same thing, I have 2 renewable subscriptions with introductory offer and discount (launch discount + free trial).
I noticed there is a method available to purchase with offers:
export declare const requestPurchaseWithOfferIOS: (sku: string, forUser: string, withOffer: Apple.PaymentDiscount) => Promise<void>;
But withOffer
requires some kind of signing:
* @param {Apple.PaymentDiscount} withOffer The offer information
* @param {string} withOffer.identifier The offer identifier
* @param {string} withOffer.keyIdentifier Key identifier that it uses to generate the signature
* @param {string} withOffer.nonce An UUID returned from the server
* @param {string} withOffer.signature The actual signature returned from the server
* @param {number} withOffer.timestamp The timestamp of the signature
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
cheers.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
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.
Version 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 trialIf 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 ;)