Using Google Licensing to protect your Corona SDK App in 3 Steps

Can’t say that I ever had this issue.  I don’t know if you can set the licensing init call to a variable, and if the false is really accurate.  Wonder if that is causing the issue?

You can try checking event.response or event.errorType to see if those give you a clue.

I will try printing out the event.response and event.errortype and not using a variable to check. 

 On the simulator I am getting the message below but it is allowing me to go on. Is that unusual? 

WARNING: The ‘licensing’ provider (google) is not available on the simulator    

WARNING: The ‘licensing’ library is not available on this platform.    

Licensing only runs on Android devices.  You cannot test it on the Simulator.

As well, you must make sure that the Google account on the testing device is listed in the Google Play Developer Console for testing licensing and that you set the response correctly.

Hi,

Just looking into this Licensing thing myself.

Don’t quote me here as i am a newbie - Line 14 does not have the oncomplete ExitApp  - that you have commented out in line 18.

Have yet to test on device (takes a bit of time) but have simmed it on the simulator to see the process

–local licensing = require “licensing”

–licensing.init( “google” )

–local function licensingListener( event )

local function licensingListener()

–  local verified = event.isVerified

    verified = false

    if verified then

–    if event.isVerified then

Seems to work - or at least confirms the code flow.

T.

Restarting this thread if that’s ok…

Sorry if I’m being a bit dopey here.

Presumably I would also need to wrap this in some code to check that the system.getInfo value for targetAppStore is “google” - otherwise the licensing tries to run and throws an error on Kindle for Amazon for example…?

Or does the licensing just not run at all on other platforms?

When I don’t put that in it throws a system error on my Kindle. No nice alert like I’m telling it to if the license is invalid.

This helped my understanding…

http://forums.coronalabs.com/topic/38394-build-for-amazon-store-retain-comandroidvendingcheck-license-ok-or-no/

Restarting this thread if that’s ok…

Sorry if I’m being a bit dopey here.

Presumably I would also need to wrap this in some code to check that the system.getInfo value for targetAppStore is “google” - otherwise the licensing tries to run and throws an error on Kindle for Amazon for example…?

Or does the licensing just not run at all on other platforms?

When I don’t put that in it throws a system error on my Kindle. No nice alert like I’m telling it to if the license is invalid.

This helped my understanding…

http://forums.coronalabs.com/topic/38394-build-for-amazon-store-retain-comandroidvendingcheck-license-ok-or-no/