Reputation: 1378
I've added the in_app_purchase
flutter package and was working fine on debug (followed the setup instructions etc.) but when I build the release apk it cannot find any of the products, all are returned under notFoundIDs
without stating any error.
I've tried flutter clean
.
Also Tried using the exact same buildTypes
config on both, same result.
Any idea why the release build would not return any queried items? Thanks.
Upvotes: 1
Views: 1273
Reputation: 111
You need to use a reserved SKU for the test: android.test.purchased
const List<String> _kProductIds = <String>[
'android.test.purchased'
];
ProductDetailsResponse productDetailResponse =
await _connection.queryProductDetails(_kProductIds.toSet());
Upvotes: 0
Reputation: 1378
Well, found the problem,
apparently queryProductDetails([...])
needs to be called after isAvailable()
returns true.
I had both calls running asynchronously and for some reason it was working in debug mode but not release.
Upvotes: 4