Viktor Ermolov
Viktor Ermolov

Reputation: 63

In-app purchase doesn't return any response

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

Answers (2)

user3413723
user3413723

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;
    }

enter image description here Need to get the one with the Play Store icon

enter image description here

Upvotes: 0

Stacy Smith
Stacy Smith

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

Related Questions