Reputation: 33
So, I've developed an app with Flutter in-app-purchase. I've configured everything on App Store Connect, created a sandbox user, etc...
However, when I run the app, but productDetails is empty...I'm testing in Testflight. Is that the issue? Should I submit it?
Upvotes: 4
Views: 1408
Reputation: 1204
If you use code similar to the one below to fetch your purchases, make sure your _kIds purchase ids in code are identical to those in Play Console.
Future<void> loadPurchases() async {
final available = await iapConnection.isAvailable();
if (available) {
const Set<String> _kIds = <String>{'product1', 'product2'};
final ProductDetailsResponse response =
await InAppPurchase.instance.queryProductDetails(_kIds);
if (response.notFoundIDs.isNotEmpty) {
// Handle the error.
}
List<ProductDetails> products = response.productDetails;
print('Products are $products');
} else {
print('Store not available');
}
}
Upvotes: 0