I have a one year auto-renewable subscription in my app with a three day free trial. According to Apple, while testing in the sandbox, a one year subscription is equivalent to one hour but it says nothing about how long the free trial is. Add to this, when I'm testing and I sign-up for the free trial, the receipt doesn't list a separate transaction for a free trial, it simply lists the first hour long subscription:
transactionIdentifier: 1000000408088544
purchaseDate: Sat Jun 16 19:58:59 2018
originalTransactionIdentifier: 1000000408088544
originalPurchaseDate: Sat Jun 16 19:59:00 2018
subscriptionExpirationDate : Sat Jun 16 20:58:59 2018
I could just check and see if the current date is less or greater than originalPurchaseDate plus three days, but shouldn't another transaction be generated when the free trial ends and the subscription is automatically renewed? That's not happening in the sandbox so I'm unsure of the behavior to expect outside of the sandbox.
In the receipt format documentation, under "Subscription Trial Period", there is a "is_trial_period" key stored in the receipt, however I am validating the receipt locally and believe that I am unable to obtain this value since there is no ASN.1 Field Type and it seems to be stored in JSON when doing server validation.
Does anyone have any clue how to test this or know what the behavior is supposed to be?
Related
My server received a INTERACTIVE_RENEWAL notification for a (unsupported) 6 month subscription from the iOS App Store just 10 minutes after it received INITIAL_BUY notification for a 3 months subscription.
How should I handle this?
The long story:
A month ago I have released a new version of my app introducing auto renewing subscriptions. I have created different subscription products, e.g.
com.my.app.subscripton.3months
com.my.app.subscripton.6months
com.my.app.subscripton.12months
The final version of the app which was released to the store only offers the 3 months and 12 months subscriptions. The 6 months subscription ID still exists in code but there is no UI element to purchases this subscription (double checked!)
My server now received the following App Store Update Notification messages within 10 minutes:
02:00 - INITIAL_BUY of product com.my.app.subscripton.3months. Expires on 2020-01-28 02:00:00
02:10 - INTERACTIVE_RENEWAL of product com.my.app.subscripton.6months. Expires on 2020-04-28 02:10:00
How should I handle this? Obviously it makes no sense, that a 3 month subscription is renewed after 10 Minutes...
According to the docs an INTERACTIVE_RENEWAL means:
Indicates the customer renewed a subscription interactively, either by using your app’s interface, or on the App Store in account settings. Make service available immediately.
Since the apps UI does not provide an option to purchase the 6 months subscription this has to be done by the account settings. But where do I find a purchase feature in the account settings?
Even if such a feature exists somewhere in the settings, how can a 3 month subscription renew with 6 months just after 10 minutes?
EDIT: The information from the notification is correct. I re-validated the receipt and the store replied with the latest receipt information which includes to IAP items (3 and 6 months subscriptions) purchased within 10 minutes.
So the information is correct but makes obviously no sense...
In the App Store subscription management page users will be able to see all of the product options for the Subscription Group that they're subscribed to (see image).
It's not uncommon for more savy iOS users to navigate to this page shortly after purchasing a subscription to see if there is a lower priced option available.
As far as handling these events, what you you trying to do exactly? All you really need to determine if someone is subscribed is the product_id and expiration_date. If possible you can log the entire event body somewhere (in case you need it later) then update your user record with whatever values you need from the event. These may be:
Access level (most apps have one access level e.g. "premium")
Product Id
Expiration date
Auto-renew status
With this setup the actual event type becomes irrelevant, you're just updating the fields you need with the values from the latest event.
It's Apphud again. We are using Apple Notifications just to trigger additional receipt validation.
How to handle in your case? Make receipt validation and check whether subscription is active.
These notifications only tell you that something has changed in user's receipt. You have to check manually what has changed and update user subscription status after receipt validation complete.
Here is more info about notifications: https://blog.apphud.com/subscriptions-notifications/
Goodmorning everyone ! I have a little question that I would like to ask you without going to waste an incident with Apple ...
In practice I am validating the receipt of payment for an in-app purchase, specifically a one-month subscription that unlocks some features of my app.
I parse the json correctly and apparently it seems to work fine but this does not always happen! In fact it often happens that the expiration date that I go to read from the json is not correct as if the subscription was not included in the receipt and I fished only those of the day before or in any case the previous ones.
This happens in sandbox and having checked the code and reviewed well, the parse of the document I could not find a solution because often the validation of the subscription is successful. I also searched online to see if it was a common problem but I did not find a solution or a discussion. My subscription does not include trial periods.
In the specific case this morning the first test was successful, but the validation was not valid. Checking the date shown was that of the previous day and then a previous subscription made yesterday. Once the subscription to the second test expired, the subscription was successful and also validated.
Our iOS App supports yearly subscriptions with different free trial periods. We are aiming to evaluate the receipts available locally on user's device offline.
**We are planning to do this: **
Check if cancellation_date exists - inactive subscription
If cancellation_date doesn’t exist, check if purchase_date exists:
if yes, check if expires_date exists and is in an active period - active subscription
if not, check if expires_date exists and is in an active period - may be trial period
The thing we cant figure out is, if user turns-off subscription in trial period stopping payment, how can the app know such events?
Does expires_date indicate "trial duration + 1 Year" or only "1 year"?
Does original_purchase_date or purchase_date indicate "start of trial" or "the date user has made payment"?
Note: We also plan to periodically refresh local receipt using
SKReceiptRefreshRequest.
Make sure you are looking at the sub-contents of all the in_app entries, ASN1 type 17. There will be one for each renewal.
Cancellation date is only set if the subscription is cancelled by Apple customer service, you should mostly depend on the expiration date.
The trial is treated as separate in_app field in the in_apps array. So as long as you are looking for the latest expires_date field, you will be computing the correct expiration date.
Also, I'm not sure how up to date the in_apps are when using SKReceiptRefreshRequests. Apple says to use server side validation, and the /verifyReceipt endpoint when using subscriptions.
Shameless plug, but if you are trying to implement subscriptions with less effort you might want to try my service, RevenueCat. We handle all the receipt parsing and tracking for you and do it correctly. You can sign up with my referral code.
iTunes Connect DAILY reports for our app shows lets say 52 purchases a day... but according to our server logs, there was 55 purchases processed on the same day for which the items were delivered.
How is this possible?
Our server is keeping all the original purchase receipts (all 55 of them) and even now we can re-validate all of them with the apple servers successfully.
We are using "original_purchase_date_pst" in the receipt to identity the date of purchase which we believe what iTunes uses when downloading the DAILY report (We did tried matching with all other "purchase_date" fields in the receipt... but with no success)
The daily report shows NO REFUNDS...
We do have "transaction_id" for all 55 purchases, but there is no way to match them against the DAILY REPORT.
Please help,
UPDATE:
Contacted Apple and got a template response (as expected)...
"Apple Sales and Trends reports are working as expected. We can’t account for any discrepancies between our reports and those of any outside reporting systems.
Let us know if you have additional questions about this information. You can reach me Monday - Friday, from 7:00 AM - 5:00 PM (PST) at 1(877)-206-2092."
I had sent them the full details... but they will not even look at it!
UPDATE:
Ok, considering if its a REFUND (or REVERSAL as #Ricky suggested), how do we check which transaction was refunded? we do have all the transaction_id but the Apple report does't show any.
If you confirmed that there is no Refund. How about a Reversal of an accidental purchase (eg: purchase 2 times)?
If you read Appendix L - Newsstand Report Field Definitions for
https://www.apple.com/itunesnews/docs/AppStoreReportingInstructions.pdf
There is a field Sales/Return:
Can be S or R. R is a refund and not a reversal.
It is reasonable to believe that Apple treats Refund and Reversal differently. I believe that when it is a refund, you will see a negative value under Units on your daily report, but for a reversal, the entire transaction might be cancelled out and not even appear on the report.
I am unable to confirm on that with 100% confidence, I guess you may drop an email to Apple Itunes Connect Support for more info on reading the Sales and Trends and daily report.
Added a Screen shot for Reversal (Apple does not mention Refund):-
So is the Report By Apple treat Refund and Reversal different? You have to ask Apple support.
Add extra screen shot:-
I have a magazine app and want to implement auto-renewable subscriptions. There are 2 issues released every year. The first issue is released in april and the second issue a half year later in october.
If I implement a one-year subscription, how do I handle the subscription?
Here are my problems:
First: the user subscribed in August and is getting the april issue. Then in october the user is getting the october issue. In april next year the user has still a valid subscription but shouldn't get the april issue because his subscription ends in august. He only get the new april issue, if he renew the subscription.
My second problem is: I don't know if the user is renewing his subscription until august and can't deliver the new issue in april.
I hope you can understand the described problem and have some tips to put me in the right direction.