Flutter in-app purchase
in-app purchase for Android and iOS
- library to use: in_app_purchase (version: ^0.6.0)
- I will focus on outer settings, since the code is well-explained in official document(https://pub.dev/packages/in_app_purchase), and what bothered me was outer settings.
But one thing to note:
final bool available = await InAppPurchaseConnection.instance.isAvailable();
When this code does not work, then try connecting once more, like this:
(this tip is from https://stackoverflow.com/questions/59527864/iap-is-not-working-after-published-in-to-play-store-in-alpha-release)
if(!available){//try to connect againawait InAppPurchaseConnection.instance.isAvailable();}
and this solved my issue.
3. in-app-purchase setting for Android
3–1. go to Google play console > app dashboard > Monetize > Products > in- app products, and add the products you will sell. I guess it’s simple enough that I don’t need to illustrate it here.

3–2. To test in-app purchase in Flutter, you should register testers. Go to Release > Testing > Internal testing (do not choose closed Testing; you will have to wait for Google to approve your app whenever you change one line of code of the app).
Here are the tips that worked for me. Tips are from https://stackoverflow.com/questions/11068686/this-version-of-the-application-is-not-configured-for-billing-through-google-pla.
Conclusions in 2021
For all of you who concerned about debugging — You CAN run and debug and test the code in debug mode
Here’s how you can test the process:
(This of course relies on the fact that you have already added and activated your products, and your code is ready for integration with those products)
Add com.android.vending.BILLING to the manifest
Upload signed apk to internal testing
Add license testers (Play console -> Settings -> License testing) — If you use multiple accounts on your device and you’re not sure which one to use, just add all of them as testers. ** (this worked for me especially — if you skip this step, you will pay Real Money for your purchase of in app products)
Run the application, as you normally would, from Android Studio (* The application should have the same version code as the one you just uploaded to internal testing)
I did the above and it is working just fine.
3–3. You need to log to the console of the result to ensure your code on in app purchase is working well. To do so, you can use emulator or real device. If you want to test in the emulator, refer to this article(https://stackoverflow.com/questions/63184370/flutter-in-app-purchase-iap-store-unavailable).
Bottomline: use emulator that has Play Store in it.
4. in-app purchase setting for iOS
Refer to this article, and just follow this: https://www.revenuecat.com/blog/apple-in-app-products-guide
One thing to note: 3rd tip might not work — like your in-app purchase item might be in the status of ‘waiting for review’ other than ‘ready to submit’. But payment works(at least for me), so just go on.
5. last thing to note: verify on server side. I wish I could have time to write on this later.