Tuesday, 18 June 2019

Flutter_Inapp_Purchase not finding any products

I am trying to set up paid products in my app.

I have followed all the guides for the Flutter_Inapp_Purchase plugin and they all say:

List<IAPItem> items = await FlutterInappPurchase.getProducts([iapId]);

Where iapId is the "id of my app". All of my other code surrounding this implementation works fine, because when I use 'android.test.purchased' as my iapId string, the test product is found and loaded into the app perfectly. So the issue is the string that I am using maybe, because no other explanation or examples are given about this anywhere.

Now in every other reference to my app ID that I have ever needed to use, it is in this format:

ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX

This is the ID I am trying to use here, but the plugin finds nothing in my store. I have a product in my store called remove_ads

So am I using the wrong iapId here? I can't imagine what else it could be asking for.

Edit:

I have found another forum which gives clearer insight into this, and the iapID here is the ID as it is shown in the URL of your developer console. URL is similar to as follows:

https://play.google.com/apps/publish/?account=7945092697149#AppDashboardPlace:p=company01.appname&appid=4975704006

So acccording to what people are saying, the iapID in this case has to be 'company01.appname'

Entering this into the app results in no products at all.

Then I read that the app name in the code has to match this app name from the console URL, and I have been rewriting an old application under the name company02.newapp

So I went back through the entire app and updated the app name to company01.appname by doing a search for company02 and changing every entry.

This results in no products being found.

So then I deleted the remove ads product from the store, ad readded it manually, in case it had become bugged in some way. This resulted in no products being found.

But still, as soon as I change the iapID to 'android.test.purchased' which is the google test repository, it works immediately, and the app populates with the test product. So I know the code is absolutely fine here, it just will not find anything from my actual store. Does anyone have any experience with this? Are there any sections of code that will help here? I am really desparate for help on this one.

Edit 2:

I have since refactored my app back to company02.newapp, since I am not sure if it will allow me to change this, and instead I rebuilt the entire store in the google developer console to match this name. Added everything I required, added the in-app product.

company02.newapp was found without issue by Admob, and I connected Admob to this store ID and added new banner items. That all works fine.

Back to the plugin again and tried to use 'company02.newapp' as the iapId. 0 products found.



from Flutter_Inapp_Purchase not finding any products

No comments:

Post a Comment