Skip to main content
Question

FLUTTER: getProducts return empty array. Turns out that product.identifier is NOT the product id

  • August 14, 2025
  • 1 reply
  • 56 views

Forum|alt.badge.img

We were running into an issue during migration to 9.2.0 where we needed to call Purchases.getProducts([product.id]) before calling Purchases.purchaseStoreProduct(storeProduct).

Previously we were calling Purchases.purchaseProduct(product.identifier), so we thought it would be an easy transition. But we kept getting an empty array from getProducts().

Finally, we realized that RevenueCat product.identifier is NOT the product id (at least not any more for Google Play). Instead, RevenueCat’s product.identifier is a concatenation of product.id:base_plan in Google Play.

RevenueCat does display the actual Google Play product id, but it’s called both “Subscription Id” and “Product Group” in the console. And neither of those attributes are part of the StoreProduct attributes in the SDK.

We could parse the existing product.identifier, but that seems like a hack. Does anyone have a suggestion for how to get the actual Google Play product id programmatically via the Flutter SDK?  The thing that RevenueCat calls Subscription Id and Product Group? 

This post has been closed for comments

1 reply

Forum|alt.badge.img
  • Author
  • New Member
  • August 15, 2025

Just a bit more context from https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getProducts.html

getProducts static method

Future<List<StoreProduct>> getProducts(

  1. List<String> productIdentifiers, {
  2. ProductCategory productCategory = ProductCategory.subscription,
  3. @Deprecated('Use ProductType') PurchaseType type = PurchaseType.subs,

})

Fetch the product info. Returns a list of products or throws an error if the products are not properly configured in RevenueCat or if there is another error while retrieving them.

productIdentifiers Array of product identifiers // this is incorrect for Google Play products, need to pass something like product.identifier.split(‘:’)[0] in the list array)

 

And on https://pub.dev/documentation/purchases_flutter/latest/models_store_product_wrapper/StoreProduct-class.html

StoreProduct class

identifier → String

Product Id. //this is incorrect for Google Play products, product.identifier is a concatenation of product.id:base_plan