Solved

purchaseDiscountedPackage in real ios device(Flutter)

  • 12 January 2022
  • 1 reply
  • 37 views

Badge +1

I am using  monthly and annual package in my app. They have 3day trial option.I used these method:

 

var paymentDiscount = await Purchases.getPaymentDiscount(
choosedoffer!.product, choosedoffer!.product.discounts![0]);

purchaseinfo = await Purchases.purchaseDiscountedPackage(
choosedoffer!, paymentDiscount);

to make a purchase.It is working while i am testing but when i uploaded to the app store from other’s people’s Iphone i realized that it isn’t working.Payment screen do not come to the screen but in test mode it is coming.How can i solve this problem?

icon

Best answer by sundeep 21 January 2022, 22:16

View original

1 reply

Userlevel 3
Badge +8

This question was handled through our ticketing system, but posting the response here as well for visibility: 

Try to check whether you were testing with users who had never subscribed before. `getPaymentDiscount()` will only return a valid result for users that are eligible for the promotional offer, so they'd have to have an active or expired subscription already. It won't work for new users who haven't bought a subscription before.

For more context, you can read about eligibility for promotional offers from Apple's docs here: https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/subscriptions_and_offers/implementing_promotional_offers_in_your_app as well as in RevenueCat's docs here: https://docs.revenuecat.com/docs/ios-subscription-offers#2-show-the-subscription-offer-to-desired-users 

Reply