Skip to main content
Question

Sync iOS promo code use in flutter

  • October 30, 2024
  • 1 reply
  • 132 views

Forum|alt.badge.img

I’m using promo codes in my flutter app to provide my iOS users with a lower price for the first month of their monthly subscription. Currently I am taking them to url below instead of opening the promo sheet. Once they come back I call the Purchases.syncPurchases() method. While testing its not letting me use iOS test card that is available in the sandbox environment. So I am not sure how to test wether the purchase is synced under their Revenuecat customer info once they come back. As the purchase is done in app store, I’m not sure how Revenuecat syncs their customer info to the Apple account as they are outside of an environment where they are logged in (my app). My app is currently in production. Also please note that I have implemented subscriptions months ago and they are working fine. Sorry if this is a bad question.

 

 

https://apps.apple.com/redeem?ctx=offercodes&id={apple_app_id}&code={code}

This post has been closed for comments

1 reply

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 392 replies
  • November 1, 2024

Hi @zain-1983-6e1bba,

Just for clarity, it looks like you’re using offer codes - it’s a little confusing but Apple does have both offer codes and promo codes, which can act differently, so I just wanted to clarify which one we’re discussing.

These can be tough to test in the sandbox, but it sounds like you’re doing the correct thing. `syncPurchases` triggers a resync between the user’s device and our servers - the idea being that the purchase made with the offer code will have been added to the receipt saved to their device and resyncing will give RevenueCat access to the updated receipt. 

You can check that this worked a couple different ways. You can check manually on their customer page in your RevenueCat dashboard. Or, programmatically, you can check their customerInfo by calling `getCustomerInfo` to get an updated response and see if they are subscribed (you can also set up a delegate which listens for changes to customerInfo). You can also check customerInfo with the REST API GET/subscriber endpoint. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings