Solved

Migrate purchases_flutter versoin 4 to 5

  • 26 September 2023
  • 3 replies
  • 264 views

Badge +3

Hello, I'm using RevenueCat on Flutter (purchases_flutter).  
Yesterday Google sent me a mail that the previous PBL version 4 will be deprecated so upgrade to PBL version 5.
My using purchases_flutter version is 4.2.2. So I have to change version to 5.7.0.

But there is no new version of purchases_flutter documentation.

final purchaseInfo = await Purchases.purchaseProduct(REMOVE_ADS_ID);

Previous I used this code. But now how I can fix it?

icon

Best answer by Aziz.cs 26 September 2023, 17:00

View original

3 replies

Badge +1

You may get the StoreProduct instance first by ID then Purchase it:

List<StoreProduct> productList =

await Purchases.getProducts([productID]);

await Purchases.purchaseStoreProduct(productList.first)

Badge +1

Hello, I'm using RevenueCat on Flutter (purchases_flutter).  
Yesterday Google sent me a mail that the previous PBL version 4 will be deprecated so upgrade to PBL version 5.
My using purchases_flutter version is 4.2.2. So I have to change version to 5.7.0.

But there is no new version of purchases_flutter documentation.

final purchaseInfo = await Purchases.purchaseProduct(REMOVE_ADS_ID);

Previous I used this code. But now how I can fix it?

Some solution?

Badge +1

You may get the StoreProduct instance first by ID then Purchase it:

List<StoreProduct> productList =

await Purchases.getProducts([productID]);

await Purchases.purchaseStoreProduct(productList.first)

How can I implement this? 

Reply