Solved

Offer code for new users in ios 14(How can I test it)

  • 10 September 2021
  • 3 replies
  • 612 views

Badge +5

I want to grant premium access to some users with offer codes and present Redeem page with this method: 

Purchases.shared.presentCodeRedemptionSheet()

It works fine ,but:

After redemption how can I verify the results(e.g entitlement ,days remaining ,etc )

and how can I test it with in sandbox environment ,is it possible?

I have my appstore connect side configured but I need some recommendation on revenue cat please.

 

icon

Best answer by tina 16 September 2021, 00:40

View original

3 replies

Userlevel 5
Badge +10

Hey @Alireza Nazer!

I don’t believe Offer Codes seem to work in sandbox :/ In the past when we attempted testing, Offer Codes always appeared as “expired” in sandbox. We recently added an offer_code field to webhooks (documentation still being worked on) that you can utilize to confirm entitlement, expiration date, etc. 

Badge +5

Hi @tina ,

Does that mean that there is a Webhook trigger for every offer code redemption from RevenueCat? What would be the event type in that case.? Where can I find more details about the event details.?

 

Thanks

Userlevel 5
Badge +10

Hey @Researchfin 

The offer_code field will be present for most webhook events. 

 

Does that mean that there is a Webhook trigger for every offer code redemption from RevenueCat? 

Yes!

What would be the event type in that case? 

INITIAL_PURCHASE We have an example JSON you can reference here: https://docs.revenuecat.com/docs/webhooks#events-format

Where can I find more details about the event details?

The webhook documentation has been shipped, you can see more information about the offer_code in this table: https://docs.revenuecat.com/docs/webhooks#subscription-lifecycle-events-fields

 

Reply