Reputation: 1792
I am developing a iOS swift application that uses In App Purchase for a single auto-renewable subscription, that has a 1 week free trial. To determine trial eligibility, I am reading the docs here. It says:
Determine Eligibility
To determine if a user is eligible for an introductory price, check their receipt: Validate the receipt as described in Validating Receipts With the App Store. In the receipt, check the values of the Subscription Trial Period and the Subscription Introductory Price Period for all in-app purchase transactions. If either of these fields are true for a given subscription, the user is not eligible for an introductory price on that subscription product or any other products within the same subscription group. You typically check the user's eligibility from your server. It's best to determine eligibility early—for example, on the first launch of the app, if possible.
Based on the receipt, you will find that new and returning customers are eligible for introductory price or free trial discounts as follows: New subscribers are always eligible. Lapsed subscribers who renew are eligible if they haven't previously received an introductory price for the given product (or any product within the same subscription group).
The problem is that the JSON returned by the server sometimes does not contain a "latest_receipt_info" key, it contains only the environment, status, and receipt fields. In this situation how to ascertain the user's trial eligibility ? any help is greatly appreciated.
P.s. The JSON does always contain a status of 0 so the communication with the server works well.
Edit: I cannot just presume the trial is not available if the key is absent, because I have tested situations in which there is no key, but I am offered a trial upon subscription.
Upvotes: 0
Views: 312
Reputation: 5169
The latest_receipt_info
key will be missing for receipts that don't have an auto-renewable subscription purchase on them.
I cannot just presume the trial is not available if the key is absent, because I have tested situations in which there is no key, but I am offered a trial upon subscription.
Was this in Sandbox? I didn't think this could be possible in production.
For what it's worth Apple automatically manages intro-eligibility and there's nothing you need to do in order for someone to get the intro offer or not. This documentation is just for you to update any UI components you want to - but I've never heard of an app getting rejected for not reflecting intro-eligibility in the UI.
Upvotes: 0