I am implementing App Store subscription (promotional) offers in an app, and I need to implement a check similar as the checkTrialOrIntroductoryPriceEligibility SDK function.
This article here suggest I could use an existing entitlement as a means to validate that, however an entitlement could have been acquired in another platform, thus tricking me into promoting an offer Apple will not honor.
Apple suggests instead:
You can check whether the receipt contains any existing or expired subscription purchases to identify these current or lapsed subscribers.
Which seems pretty simple, but the SDK doesn’t seem to expose this kind of information - wether a specific product identifier has ever been purchased on iOS. The raw ReceiptParser also has no public parsing methods I could use. I would have to resort to manually parsing the local receipt, which makes no sense when using RevenueCat.
I also see a property called in PurchaserInfo called allPurchasedProductIdentifiers. Could this be used to determine elegibility maybe? I’m not sure if that is server-side information which would also collect purchased items from Android, or if that could solve this.
Is there anything I’m missing? I see an entitlement has the store and periodType that I could try to match .appStore and .normal, but I’m afraid where that could come from? Do those refer to the first / last / random instance of activation of the entitlement?
Finally, the proper solution to this should become a SDK public function, in my opinion :)
Best answer by Rafael Nobre
I had the misconception that promo offers eligibility was tied to the specific SKU and not the subscription group! So you are right that the introductory eligibility dictionary can achieve what I need, with the following snippet:
let isEligibleToPromotionalOffer = introElegibilityDictionary[product.productIdentifier]?.status == .ineligible
We can add any additional requirements we want on top of it, but this is enough to avoid a failure in applying a discount that we had shown on the UI.