IAP Badger: a unified approach to in-app purchases

It seems as though all references to the badger plugin need to be removed when installing to iOS Simulator, is that correct?  I keep getting a “module plugin.iap_badger not found:resource (plugin.iap_badger.lua) does not exist in archive” error.  

It looks like your app isn’t downloading the IAP Badger plug-in from Corona’s servers during your build (there was an issue with their servers a couple of weeks back that was reported in this thread that has since been rectified).

It may be worth logging out of and restarting the Corona simulator in order to refresh the library.

Simon

I had tried several things to get it to work but in the end gave up and instead implemented to badger lua file.  I imagine this will continue to be updated on github in the future?

Yes - both will be maintained.  The version on Github tends to be slightly ahead of the plug-in.

Thank you iap_badger. I have published my first android game.

Good luck   :smiley:

Hi there.  I have a question about the fake items.

I can’t see them in the text file.  Everything else seems to be working.  Some code is below.  Basically equivalent to example code.  Any ideas?  Thanks in advance.

local catalogue = { --Information about how to handle the inventory item inventoryItems = { coins = { productType="consumable" }, gems = { productType="consumable" }, --Some fake products to save along with it pixelGammaAdjust = { productType="random-integer", randomLow=1, randomHigh=75, }, timeGammaAdjust = { productType="random-decimal", randomLow=150, randomHigh=250, }, }, products = {... a bunch of products ...}, }

Hi there,

The reason they are not showing up is that you have to add them to the inventory (like you would for a real item).

Simon

Does calling loadProducts with an event listener work in the editor?  It seems like the listener is not called, but I just wanted to be sure it’s not something I am doing wrong.

thanks,

–john

Hi John,

In previous versions of IAP Badger, this was a bug.

loadProducts failed to call a listener when running in debug mode.  This has been fixed in the latest version (version 5 - both have been uploaded to Github and the plug-in).

Simon

By the way - in production, on real devices and real app stores, loadProducts worked as expected.

Thanks Simon.  I just wanted to be sure I was using the call correctly.  Will get the update.

Thanks for the quick fix!  The plug-in is great!

–john

Hi Simon

It’s me again.

I’ve currently got someone testing my game on their Kindle but they’re getting a plugin not found error, I’m attaching 2 screenshots.

screen1.png

screen2.jpg

Any ideas what might be causing this?

It looks like your app isn’t finding/downloading the Amazon IAP plug-in - but your build.settings file looks good to me.

Try updating to the latest daily build, rebuild your app and see what happens.

Simon

Thanks for the reply Simon, I’ll give it a try.

@happymongoose / Simon … Hi.

Quick question, I set up iap badger a while ago and am cleaning up things before publishing now… I noticed I have several plugins included in build.setting which I’m not sure I need. ( they may be left over in there from before I discovered your plugin )
 

-- Google Play Services ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true, ["android-kindle"] = true }, }, -- Google in app purchases ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true } }, -- In App Purchases Badger ["plugin.iap\_badger"] = { publisherId = "uk.co.happymongoose", },

Are the first two needed for your plugin to work or can I get rid of them?

Hi Julius,

IAP Badger sits on top of plugin.google.iap.v3 , so you definitely need that.

plugin.google.play.services is nothing to do with in-app purchases - but it does allow your app to access Google Play leaderboards and achievements etc., so if your app uses those, leave it in.

Simon

I am still not seeing my listener executing when loadProducts is finished, including both the simulator and on devices.  I noticed the plugin date is still 26-May-2016.

Is there a minimum build version of Corona?  I am using 2016.2883

thanks!

Could you share the relevant section of code (where you call loadProducts and your listener function)?

Simon

Simon,  

local function onProductsLoaded() -- testing print ("Here I am") -- this never is printed products = iap.getLoadProductsCatalogue() end function scene:create( event ) local sceneGroup = self.view iap.init({ catalogue = catalog, filename = "stats.txt", salt = "xxxxxxxxxxxxxxxxx", failedListener = onPurchaseFail, doNotLoadInventory = true, debugMode = true, debugStore = "apple" -- apple, google, amazon }) -- other app stuff here end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Called when the scene is still off screen (but is about to come on screen). if not iap.getInventoryValue("purchase") then iap.loadProducts(onProductsLoaded) end elseif ( phase == "did" ) then end end