Auto Renewable Subscription Details

We are implementing Auto Renewable subsciption and allowing user to view the content for one month free trial in the app.

How can we track the payment of user for free trial as we require this information that whether the user is using free subscrition of paid, so in case after reciept validation's success if itunes sends this info then we want to know how?

Replies

Maybe this thread helps:


https://forums.developer.apple.com/thread/49344

To answer your question, first you should note, that the applicationReceipt provides no direct information as to the prices paid by the user, for the application and for in app purchases. The app can only detect that the user account was charged appropriately for the in app purchase item associated with the in app purchase identifier.



With regards to how the auto-renewing subscription purchase is handled, when there is a free trial, the iTunes Store will update the applicationReceipt to include an in_app array where the expiration period matches that of the free trial. Then when the free trial is over and the Store sees that the auto-renewing subscription is still in effect, the user account is charged for the auto-renewing subscription rate and the Store creates an incompleteTransaction record. This happens on the date when the subscription item is set to expire. The only way to detect that the user is in the free trial period is to determine the length of the subscription period and compare the length to the subscription length associated with the in app purchase identifier associated with the in_app array receipt item.



What this means is that suppose the application offers a one_month subscription - the identifier is com.mycompany.app1.one_mo_auto_renew_sub. When the iTunesConnect record is set up, the developer selects the option to allow a free trial period for the iAP identifier - com.mycompany.app1.one_mo_auto_renew_sub. When the user purchases this in app purchase for the first time, and iTunes sees that the user is eligible for the free trial, the applicationReceipt will be updated to include an in_app array item with the iAP identifier - com.mycompany.app1.one_mo_auto_renew_sub and the expiration period will be 7 days (I think this is the free trial period for a one month auto-renewing subscription - but I could be wrong). The app when it validates the receipt - either statically or via the iTunes Receipt validation server will detect that the expiration date is greater than the current date - to know that the subscription item is active, and calculate the length of the subscription to know that it's seven days. In this way, the app will know the subscription is in the free trial period. If the duration of the period matches that for the iAP identifier, then the app is past the free trial period. Note that a free trial is only offered once per user account. IF the user cancels the free trial and purchases the auto-renewing subscription a second time, they will no longer be eligible for the free trial.


Some additiona l comments on this matter. The app needs to all items in the in_app array to identify the one with the active subscription. Don't make an assumption that the most current item is the last item in the in_app array. Also, if you find that the cancellation_date field is set, that means for that one subscription, the user contacted Apple Care and recieved a refund for that purchase only. If the user purchases the auto-renewing subscription again later on, then there will be a new receipt with more recent dates.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Hi,


Appologies if this isnt the correct place to post, but i couldnt find a "new post" anywhere in the forums


We are developing a new app that has a subscription model, ive explored itunes connect and it appears I cannot setup a subscription product until I submit the app for review, but then we would have to go live with a product that doesnt have subscrciptions it in. we would also have to wait until we finish the app before we even start to explore these features.


Can you give me some assistance here?


kind regards

1) type in a question title at the top of the screen to start a new thread. 2) you can create an IAP and test it in the sandbox before launch

Thank you for this write up, I also needed to identify when users were in a trial period and this helps tremendously. I wonder if you would mind elaborating on your statement "Note that a free trial is only offered once per user account." ? How exactly is this achieved? I had heard that a user can simply delete the app and reinstall and obtain an unlimited amount of free trials. Can you confirm?


Thanks!


Claire

Rich is describing a system that is controlled from Apple servers on an iTunesAccount-by-iTunesAccount basis. The Apple servers are unaffected when a user deletes the app and reinstalls it. They retain the information that that iTunes Account made the purchase. However, if a user deletes the app and changes to a different iTunes Account and then purchases the app under that different iTunes Account then the Apple servers will give them a free trial under that new iTunes Account.


The other approach is to record something somewhere that remembers what the user did. You can use your server but you have to protect against the user creating a different account on your server. You can write something to the keychain on the device (most non-renewing subscriptions use this method). The keychain survives delete and reinstall of the app. But the keychain has two weaknesses - 1) each device allows the user to get a free trial on each device and 2) a keychain can be backed up before the app is installed and then restored after the free trial thereby 'fooling' the app into thinking there was no free trial. This is a fairly extreme thing for a person to do. The keychain is your friend. I do not know if the keychain 'remembers' the app if it is deleted and reinstalled under a different iTunes Account - but I think it does.

That is really helpful PBK, thank you.

I am hoping to pick your brain a little further. If a user subscribes to an auto-renewable service but subsequently cancels this somewhere along the line, this should disqualify them from any further free trial. If the user comes back to the app and opts to re-subscribe, and is signed in as their original iTunes account, what if anything can be prested to the user in app to inform them they are no longer eligble for another trial?. Using netflix as an example, if a customer clicks subscribe, they are show a subscripton terms iOS alert box that references the free trial as part of the subscription purchase confirmation. Is the content in the alert generated by Apple (if they are responsible for ascertaining if the iTunes account has had the trial). What would be shown to a user who has already utilised a trial. I cannot find any documentation on this anywhere :-(

As I understand, the free trial is managed by the iTunes Store in conjunction with private methods provided by iOS to handle the user interface. There are no API's for the application to help manage the process. When a user selects to make an in app purchase which includes a free trial option, the iTunes store presents the UI to the user - so long as that user account has never purchased that iAP identifier. Once that user account accepts to buy that iAP item with free trial, the free trial is not offered to the user again, even if they contact Apple Care and cancel the first purchase of the auto-renewing subscription. If a free trial is offered a second time to the same user for the same iAP identifier, that is a bug report to be filed against iTunes Production Support.


Note that fraud is a high priority issue with the iTunes Store. If you can document a sequence of events leading to fraudulent access of in app purchases and applications, I urge you to file a bug report.

rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

I am pretty certain the Apple servers will let them resubscribe without a free trial period just as it would if they had a free trial, 5 months of paid subscription, a cancellation, and then a resubscribe. I haven't tested it but it's pretty straightforward so I would be surprised if Apple isn't handling it correctly.


But what about the user who creates multiple iTunes Accounts? This is a bug in the autorenewable system. Your app can detect this using the keychain but then how do you handle the user? Best approach is to avoid using autorenewables and stick with non-renewing subscriptions. Then you control who gets a free subscription and who doesn't.