How to implement and test a free trial on iOS in app purchase in Sandbox? How to validate the flow and trial info via Apple receipts?
Asked Answered
B

3

6

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!

Bootery answered 16/10, 2014 at 10:11 Comment(0)
G
4

For in-app products with Free Trials, StoreKit on the client side issues two iOS7 style receipts in the in_app section -

  1. 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.
    
  2. 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.

Gretta answered 25/2, 2015 at 19:37 Comment(0)
C
0

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.

Changteh answered 8/7, 2015 at 16:55 Comment(0)
L
-1

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.

Lytle answered 16/10, 2014 at 10:19 Comment(2)
Thanks about this timing info. But have you got any example of the accurate code with this trial information ? I cannot find it in the the receipts field documentation from developer guidelinesBootery
this is not the answerSenegal

© 2022 - 2024 — McMap. All rights reserved.