merchantkit icon indicating copy to clipboard operation
merchantkit copied to clipboard

Add support for didRevokeEntitlementsForProductIdentifiers

Open ryanmeisters opened this issue 4 years ago • 5 comments

Thanks for an awesome library @benjaminmayo 🙌

iOS 14 adds a new didRevokeEntitlementsForProductIdentifiers delegate method to SKPaymentTransactionObserver (docs here)

From the docs:

The system calls this delegate method whenever App Store revokes in-app purchases for the user. For example, it’s called when a user leaves a family sharing group that was sharing in-app purchases. By leaving the family group, the user is no longer entitled to the shared in-app purchases.

The productIdentifiers parameter contains the revoked product IDs. Your app should check the receipt on the device, which the system automatically updates prior to calling this method, and provide the correct level of access for the in-app purchases — which may now be no access. If you use server-side receipt validation with the App Store, call your server to reprocess the receipt and update your purchase records.

ryanmeisters avatar Aug 09 '20 17:08 ryanmeisters

Thanks for bringing this to my attention. I haven't looked at the iOS 14 StoreKit stuff yet. The good news is this API should be easily supportable inside of MerchantKit in a future update.

benjaminmayo avatar Aug 09 '20 17:08 benjaminmayo

@benjaminmayo could I create a PR to add this capability?

Looks like this one is related to #70

imWildCat avatar May 18 '21 00:05 imWildCat

Sure, I'm happy to look at anything put forward. The implementation of this should prolly consist of a call to checkReceipt from the didRevoke... delegate callback.

benjaminmayo avatar May 18 '21 08:05 benjaminmayo

I created a draft PR: #71

Could you help to check whether it is on the right direction?

imWildCat avatar May 18 '21 15:05 imWildCat

Update: I'm very new to IAP. Just found that this library (https://github.com/tikhop/TPInAppReceipt) can parse the receipt. Will investigate it.

imWildCat avatar May 22 '21 13:05 imWildCat