I want to create a trial period ( 1 week) on my 1 month AR subscription in App purchase application via iTunes Connect. The question is, how to test it in sandbox and have the accurate information in Apple receipts that indicates the differenciation of status between the trial time period and the paying subscription? Thanks!
For in-app products with Free Trials, StoreKit on the client side issues two iOS7 style receipts in the in_app section -
When the user hits Buy which starts the free trial. User is not charged at this time. The receipt sent to the server for verification will have :
expires_date_ms - purchase_date_ms = Number of Free trial days.
When the free trial days are up and if the user has not turned OFF autorenewal from Manage subscription screen, another receipt is issued and this time the user is charged. The receipt issued will have
expires_date_ms - purchase_date_ms = Term Length
If the user has turned off autorenewal before the free trial expires, the server should detect this and turn off the subscription for the user.
I did trial payment in production account and got receipt from appstore. This receipt included field "is_trial_period" as "true". But after trial period I get receipt with real bill and it does not have trial fields.
I am writing logic as:
- If receipt have "is_trial_period" field after validation and it true - it is trial receipt
- If receipt fields "original_transaction_id" != "transaction_id" - it is real bill, I am finding original transaction in my own DB and renew it.
But appstore documentation does not have same trial field information. Sandbox does not this field to.
First you need to create a test user from your iTunes account
and register your app for in app purchase
. Then you can use your that test user for purchase the subscription. Here apple had provided some facility like your 1 month subscription will be equivalent to 5 minutes and 3 equals to 15 minutes approx and so on. Also if you are using it as auto renewable in app purchase it will renew for 3 to 4 times not fixed as I tested.
© 2022 - 2024 — McMap. All rights reserved.