Promotional Offers Eligibility

  • 4 September 2021
  • 3 replies

Badge +1

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 :)

Thank you!




Best answer by Rafael Nobre 16 September 2021, 17:08

View original

3 replies

Userlevel 3
Badge +8

We have a method called checkTrialOrIntroductoryPriceEligibility on iOS that accomplishes this. It’s not well documented in our guides so I linked directly to the function in GitHub which includes documentation in the comment. Let me know if you have any questions!

Badge +1

Hello, thanks for getting back!
I already use that method, which for Trial/introductory eligibility depends on the receipt not having any records for any of the products in a subscription group. Promotional offers (those that need server-side additional signing to work) eligibility is about having any records of a specific product in the receipt (Active or not).

Badge +1

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.

Thank you!