purchasepackage is working for monthly subscription but same code is not working for annual subscription

  • 17 September 2021
  • 1 reply

Badge +4

Hi, I am using flutter to implement purchase package. My code looks like ;


_purchaserInfo = await Purchases.purchasePackage(packages.first);//print('purchase completed');appData.isPro = _purchaserInfo.entitlements.all["all_charts"]!.isActive;


This code is invoked on a click of a button. It works fine for monthly subscription but when I use same code for annual subscription, nothing is happening. I just get following messages;


D/[Purchases] - DEBUG(13801): ℹ️ Vending Offerings from cache
D/[Purchases] - DEBUG(13801): ℹ️ Checking if cache is stale AppInBackground false


Best answer by sharif 21 September 2021, 00:43

View original

1 reply

Userlevel 5
Badge +9

It seems like the SDK isn’t making the API calls to purchase the annual package. I would first check to make sure the following:

  1. You’re selecting the correct package to purchase (if you’re using syntax like packages.first, make sure you’re selecting the annual package.)
  2. If you can reproduce the issue in sandbox, try placing some breakpoints in your code, for example when the button is pressed, when purchasePackage is called, etc. to make sure you’re hitting the correct code.
  3. From what you pasted it seems to me that purchasePackage simply isn’t being called, but feel free to paste the entire debug logs from when you launch the app all the way until you hit the bug.

Let me know if the tips above don’t help!