Redeem Promo Code doesn't work

When I parse receipt there is no any subscription.

Checked on several apps on several developer's accounts.

Previously it worked correctly and looks like broken several days ago.

Replies

>Previously it worked correctly and looks like broken several days ago.


In that case, you might need to ping support to ask them to take a look on their end, while also filing a bug against the tools. Haven't seen similar reports yet, tho.


Otherwise, it may help to confirm your process via this from the docs:


Calculate a Subscription's Promotional Offer Status

You can set up promotional offers in App Store Connect to provide users with free or discounted service for a subscription. All new and eligible subscribers can redeem an introductory offer, and all lapsed and existing subscribers can redeem a subscription offer. There are multiple types of introductory and subscription offers, each with different billing cycles. Customers who redeem a free trial introductory offer or a downgrade subscription offer will not be billed for the subscription until the end of the free trial period. For more information, see Implementing Introductory Offers in Your App and Implementing Subscription Offers in Your App.


Check the

is_in_intro_offer_period
or
is_trial_period
field from each receipt entry to validate whether the user redeemed an introductory offer at the beginning of their subscription. You can use this information to accurately present subscription products from the same subscription group at the end of the introductory offer period for that user. Check the
promotional_offer_id
field from each receipt entry to validate whether the user redeemed a subscription offer. You can use this information to determine eligibility for this user to redeem subscription offers in the future.

I've had a couple of reports recently where the app's updatedTransactions delegate method is called to process a StoreKit purchase of an auto-renewable subscription. When the app process validates the appStoreReceipt, the in_app array is empty. If the user then deletes the app, then re-installs the app from the App Store, the appStoreReceipt now contains the auto-renewable subscription item in the in_app array.


This is a bug report issue to be investigated by the App Store Server QA. Ideally, it helps if you can capture the base64 encoded appStoreReceipt as it exists following the first purchased notification. The App Store Server QA also needs the iTunes User account name so that they can investigate the user purchase history.


However, if this is a different issue, disregard the following and clarify what is meant by "no subscription".


To submit such a bug report, please use the Apple Developer Feedback web page -

<https://feedbackassistant.apple.com/>.


Enter the “Feedback Assistant” page and login

Click on the Compose icon to start a new bug report


Start by clicking on the appropriate OS button - “iOS and iPadOS”


1. In the “Problem Area” field select “StoreKit”

2. In the “Type of Feedback” select “Incorrect / Unexpected Behavior”

3. In the “Describe the Issue” section enter the following

- application ID (and In-App Purchase identifiers if appropriate)

- production environment

- a copy of the base64 encoded appStoreReceipt following the first notification

- the iTunes user account

- the date-time of the purchase.


A reminder, if for any reason, the app cannot validate a purchase, or is not able to complete the delivery of the purchased content never call finishTransaction.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

I just noticed the title and realized that I didn't answer the question - when a promo code is redeemed, there is no push notification to the app to update the appStoreReceipt. Instead, the App Store processes the redemption by creating an incompleteTransaction on the iTunes User account. It's the responsibility of the app to query the App Store for the incompleteTransaction and process it.


The app does this by calling addTransactionObserver early in the app launch process. The fact that your app is checking the appStoreReceipt and not finding the purchase leads me to believe that the app has not called addTransactionObserver by the time the app validates the appStoreReceipt. StoreKit engineering recommends calling addTransactionObserver in the didFinishLaunchingWithOptions method. The main point is to make the addTransactionObserver call, before the point that the app makes the decision - does the user have access to premium content.


When the addTransactionObserver call is made, the transactionObserver sends a URL request to the App Store Server to ask whether there are aany incompleteTransactions. In the case of the promo code redemption there will be one and the updatedTransactions delegate method will be called to process the purchase in the same manner as if the user had just pressed a "Buy" button.


At the same time that the purchased event is processed, the appStoreReceipt is updated and should now show the auto-renewable subscription in the in_app array upon succesful validation.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

>The main point is to make the addTransactionObserver call, before the point that the app makes the decision - does the user have access to premium content.


If the app's 'decision' is "yes" then there is no need to addTransactionObserver (and the associated class that handles StoreKit). So you can do the addTransactionObserver only if and when the app intends to deny access to premium content. You can also delay the addTransactionObserver until the user responds affirmatively to an alert "Your subscription seems to have expired. Do you want to check whether it was renewed?".


Are you sure that addTransactionObserver won't 'surprise' the user with a request to log into the App Store under certain circumstances?