benjaminmayo / merchantkit

A modern In-App Purchases management framework for iOS.
MIT License
1.11k stars 72 forks source link

know if a free trial is in progress or has expired? #32

Closed ghost closed 5 years ago

ghost commented 5 years ago

How can I tell if a free trial / introductory trial for 7 days is never used, currently being used or has expired? I can't seem to understand...

benjaminmayo commented 5 years ago

This is currently not possible.

ghost commented 5 years ago

Seems like a rather important feature though -- do you have a possible ETA? I'd hate to go back to StoreKit directly :-(

Kirow commented 5 years ago

Not possible out of box, but you can implement your own ReceiptValidator. In general same as ServerReceiptValidator, but different response parser and extended Receipt model (for ex.: FullReceipt: Receipt). Then you need to store it inside validator or add callback (because merchant.latestFetchedReceipt is internal) to read all json values outside framework. Not elegant, but possible. See docs in case you will try it this way.

benjaminmayo commented 5 years ago

You don't have to 'go back to StoreKit directly' wholesale, you can use MerchantKit for everything else and then just validate a receipt independently to get the free trial info out. Obviously, this is something I would like to support in the framework (eg. the introductoryOffer property should return nil when it has already been used up.)

ghost commented 5 years ago

Hi Benjamin, any eta for this feature? I really would appreciate it.

benjaminmayo commented 5 years ago

The local receipt does not document free trial status, so implementation of this is a bit blocked ATM.

xinatanil commented 4 years ago

Any ETA on the feature?