I've been searching far and wide for a solution to my problem but, although I've seen many similar questions, none of them really had the answer.
I'm developing an app using flutter and the in_app_purchase (https://pub.dev/packages/in_app_purchase) plugin. I've followed step by step the plugin and the iOS docs, but I still am not able to test the purchase.
The product is created in the app store connect features panel (let's say its ID is app_subscription
). Since I created and submitted the product, it's "pending for revision" (or something similar, I use the panel in Spanish). I've created a sandbox account to do the tests on the product. Finally, I've implemented the code needed to make the purchase from the app, but when I try to test the purchase from a physical device, I fail, since the queryProductDetails function doesn't find a product with the app_subscription
ID.
Simply put, the code that retrieves the product is like this, as the plugin doc says:
import 'package:in_app_purchase/in_app_purchase.dart';
...
InAppPurchaseConnection _iap = InAppPurchaseConnection.instance;
...
Set<String> ids = Set.from(['app_subscription']);
ProductDetailsResponse response = await _iap.queryProductDetails(ids);
print(response.productDetails); // prints: []
I started to think that the reason I can't get the product is that it hasn't been validated by the reviewers, but it has been one week and the status hasn't changed. I've filled in all the required metadata, including the screenshot.
Please tell me if you need any more info.
Thanks in advance
EDIT (2019/12/02): The app Store has finally accepted my build and published my app, but they put my product in a "needs developer action" status, allegedly because they made a purchase that was returned... The thing is, I still can't test my own purchase because the code isn't recognized yet. What should I do? I've tried editing my product description and testing the purchase again but it doesn't work...
If the products aren't being fetched by your app it's most likely a configuration issue in App Store Connect. If your products are in the 'Ready to Submit' stage then it sounds like you've set up everything that's needed for the product.
The only other thing it could be is missing the 'Paid Applications Agreement' in App Store Connect. If that isn't signed, your product fetch request will silently fail even in the sandbox.
See the Configuring In-app Products is Hard post for other common reasons products fails to fetch.