Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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 CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jo.carvalho88

[GLOBAL: userInfoPane.html]
jo.carvalho88
  • 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 )
    end
end


-- Initialize Google IAP
googleIAP.init(transactionListener )

my build settings:

 

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

usesPermissions =
        {
            "android.permission.INTERNET",
            "android.permission.GET_ACCOUNTS",
            "android.permission.RECEIVE_BOOT_COMPLETED",
            "com.google.android.c2dm.permission.RECEIVE",
            ".permission.C2D_MESSAGE",
            "com.android.vending.BILLING",
            "android.permission.ACCESS_NETWORK_STATE",
            "com.android.vending.CHECK_LICENSE",
        },

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: 

 

https://forums.coronalabs.com/topic/62601-plugingoogleiapv3-issues-listener-is-never-called/

 

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?

 

Thanks



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,865 posts
  • Corona Staff

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.

 

Rob


  • jo.carvalho88 likes this

[TOPIC: post.html]
#3

jo.carvalho88

[GLOBAL: userInfoPane.html]
jo.carvalho88
  • Observer

  • 6 posts
  • Corona SDK

That did the trick, you were right.

 

Thanks, Rob!




[topic_controls]
[/topic_controls]

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