Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Google IAP not initializing!
Started by jo.carvalho88 Jul 21 2016 03:56 PM

2 replies to this topic
iap google store bug init plugin native
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 6 posts
  • Corona SDK

Hey guys!


I'm having a problem with Google IAP plugin, the init method does not return the callback function that the doc says it should. I'm using corona docs sample code and I'm stuck.

local googleIAP = require( "plugin.google.iap.v3" )

-- Transaction listener function
local function transactionListener( event )

    print ("listener has been called")
    if not ( event.transaction.state == "failed" ) then  -- Successful transaction
        print( json.prettify( event ) )
        print( "event.transaction: " .. json.prettify( event.transaction ) )

    else  -- Unsuccessful transaction; output error details
        print( event.transaction.errorType )
        print( event.transaction.errorString )

-- Initialize Google IAP
googleIAP.init(transactionListener )

my build settings:


["plugin.google.iap.v3"] =
            publisherId = "com.coronalabs",
            supportedPlatforms = { android=true }

usesPermissions =

my config.lua has the google key configured too.


license = {
      google = {
        key = "my ridiculously long key"


I've searched the forum and there is this thread: 




but the bug was never fixed, the user started using IAP Badger, which I've considered using, but since they don't have documentation about enterprise (and I intend to migrate the project to enterprise soon) it didn't help much.


I also have tried to delay the init after calling the require function, but it didn't help either (someone mentions it in the thread above), so I'm running out of options. My game is published in Beta and Alpha, my tester accounts are set and they are not the same as the account that manages our play store profile. The package that has been uploaded is signed with the same keystore and the same package name, does anyone have a clue of what is happenning?


Corona guys, is this a known issue, do you intend to solve it? I find it very hard to believe this is a bug, because only me and the guy in that thread above had this problem and IAP aren't really something that people miss, is there something that I am missing?



[TOPIC: post.html]

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,614 posts
  • Enterprise

The .init() function defines the call back listener, I don't believe it generates any events of its own. You would need to call .restore(), .purchase() etc. to actually get events.



  • jo.carvalho88 likes this

[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 6 posts
  • Corona SDK

That did the trick, you were right.


Thanks, Rob!


Also tagged with one or more of these keywords: iap, google, store, bug, init, plugin, native