Joey Slomowitz
Joey Slomowitz

Reputation: 189

What is the correct way to determine if user is eligible for free trial with local receipt validation on a Mac App?

I am parsing receipts for an auto renewing subscription locally on a Mac app.

From this document, it would seem that receipt field 1719 should come back as true (1) when user is in the free trial or introductory pricing.

I've tried this out with the local Xcode configuration (StoreKit testing) and it does come back as true, but this never happens in Sandbox (always 0). Should this be working in production?

Does "introductory price period" (field 1719) not imply the free trial?

The same question is being asked in this Apple forum, but it's from some time ago and doesn't appear that anyone has a clear answer.

Upvotes: 3

Views: 3189

Answers (2)

Joey Slomowitz
Joey Slomowitz

Reputation: 189

The easiest way I've found to check for free trial eligibility in LOCAL receipt validation is to simply check for the number of IAP receipts. If this is empty, the user should be eligible for the free trial, otherwise you can assume that the free trial has already been used.

Upvotes: 0

tikhop
tikhop

Reputation: 2087

To determine if a user is eligible for an introductory offer, you must check the values of the is_trial_period (1713) and the is_in_intro_offer_period (1719) 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 offer on that subscription product or any other products within the same subscription group.

Personally, I use and recommend TPInAppReceipt library, it provides a variety of convenience methods to validate receipt, determine introductory price eligibility and more. It works well in all possible environment (Sandbox, Production, StoreKitTest).

Does "introductory price period" (field 1719) not imply the free trial?

If you want to check whether a user's subscription is currently in the free trial period you can check is_in_intro_offer_period value.

Upvotes: 3

Related Questions