Want to add discount offer to the subscriptions with requestSubscription #2162
Unanswered
MaximeDemurger
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Those should come from your server. Here is an explanation of the whole process: https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/implementing_promotional_offers_in_your_app |
Beta Was this translation helpful? Give feedback.
1 reply
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 Everyone,
I'm running into an issue. I want to apply a discount offer to a subscription for specific type of user.
To get all the sku I use the getSubscriptions(['sku', 'sku2']) function which return me all the valid subscriptions.
Here is an example :
[{"countryCode": "USA", "currency": "USD", "description": "", "discounts": [{"identifier": "promo8", "localizedPrice": "26.49 $", "numberOfPeriods": "1", "paymentMode": "PAYASYOUGO", "price": "26.49", "subscriptionPeriod": "MONTH", "type": "SUBSCRIPTION"}], "introductoryPrice": "", "introductoryPriceAsAmountIOS": "", "introductoryPriceNumberOfPeriodsIOS": "", "introductoryPricePaymentModeIOS": "", "introductoryPriceSubscriptionPeriodIOS": "", "localizedPrice": "44.99 $", "platform": "ios", "price": "44.99", "productId": "com.example.app.price8", "subscriptionPeriodNumberIOS": "6", "subscriptionPeriodUnitIOS": "MONTH", "title": "", "type": "subs"}]
Now to create a subscriptions to the user I use the requestSubscriptions() function
purchase = await requestSubscription({ sku: currentSelect?.id_product, withOffer: { identifier: currentSelect?.id_promo, keyIdentifier: '.............', signature: '..............', timestamp: Date.now(), }, });
This is how I use it. And when I try to call it, it doesn't apply the discount offer.
What can I do ? How can I apply the reduction ? What are corresponding keyIdentifier, nonce, and signature parameters to ?
Where can I find them ?
Beta Was this translation helpful? Give feedback.
All reactions