Closed KevinQuisquater closed 6 months ago
Found several people with the same issue, so it might not be linked to the library but be a StoreKit bug! https://developer.apple.com/forums/thread/707319 https://developer.apple.com/forums/thread/716661 https://community.revenuecat.com/sdks-51/question-about-storekit2-iseligibleforintrooffer-testing-with-sandbox-users-1623
They use StoreKit 2, and 9 months ago an engineer commented (second link) that the problem should now be fixed.
Hello @KevinQuisquater, thanks for bringing this up, and my apologies for the delayed response.
You are absolutely right, it's a "bug/feature" within the StoreKit framework. When a user calls InAppReceipt.isEligibleForIntroductoryOffer
, the library simply goes thru the local receipt to determine whether the introductory offer has been used. The inherent nature of the in-app receipt is that it's an immutable collection of purchases. It appears that when you perform 'Reset eligibility,' it doesn't actually clear the receipt itself. As a result, the library indicates 'true,' regardless of whether the eligibility has been reset.
Once again, I appreciate your input and your kind words. I'm glad to know that you find this library helpful.
Thank you very much for taking the time to look into it and answer! We will test using StoreKit2 to see if this is a StoreKit1 problem or a StoreKit problem.
(As the comment of the Apple Commerce Engineer on this post suggests that it might be fixed in StoreKit2: https://developer.apple.com/forums/thread/716661)
If you happen to know the answer, I'd love to know! Thank you.
Hi @KevinQuisquater, I hope you're doing well.
Recently, I've been playing around with introductory offers and I was able to reproduce the issue you mentioned. However, as soon as I refreshed the receipt for the sandbox user, the issue disappeared, and the library once again returned true
.
I'm closing the issue, but if you have any other issues or questions, please feel free to open another ticket. Thank you!.
Amazing discovery, thank you!
(Amazing library, thank you)
Expected Behavior
After resetting the eligibility for introductory offers of a sandbox user, the library should say that the user is eligible for that introductory offer. We have tried refreshing the receipt, deleting the purchase history of the sandbox user, and deleting and re-installing the app.
Current Behavior
TPInAppReceipt still says a sandbox user is not eligible for introductory offer after resetting the introductory offer eligibility of a sandbox user via the Settings app or via App Store Connect.
This is probably not a problem in production since a user can't reset their eligibility for introductory offers. But it makes testing the library difficult.
Possible Solution
Should work in production, since eligibility can only be reset for a sandbox user.
Steps to Reproduce (for bugs)
With a sandbox user:
false
.false
, despite the free trial being available if you try and purchase the product againYour Environment
Big thanks in advance!