Reputation: 63
I'm trying to get products from the store. Screenshot of product
ProductDetailsResponse productDetailResponse =
await _inAppPurchase.queryProductDetails(_kProductIds.toSet());
When I attempt to do that I don't even get a response. In debug the code just abruptly stops working.
The following
final bool isAvailable = await _inAppPurchase.isAvailable();
returns true
For iOS it works.
Upvotes: 6
Views: 547
Reputation: 12223
There are a bunch of setup steps. But if you run this code and it turns out the problem is that it's not available, it's probably because you have an emulator that doesn't work.
final bool available = await InAppPurchase.instance.isAvailable();
if (!available) {
print("store is not available");
error = "Store not available";
notifyListeners();
return;
}
Need to get the one with the Play Store icon
Upvotes: 0
Reputation: 46
I guess you're using in_app_purchase package? It can be buggy sometimes so I recommend using RevenueCat instead. It's way easier and works more smoothly.
Upvotes: 3