Testing Google Licensing

I did a build for Android with the new licensing configurations and my unique key without any error messages.

If I move the package that I uploaded to my Android device it terminates the app on startup after display the initial screen - telling me the licensing failed.

Shouldn’t I be able to test an app by moving it to my own device as long as the key matches the app and what Google has?

Hi,

Do you have some sample code of what you did?  The licensing module doesn’t terminate the app if it fails on itself so I’m at a bit of a loss.

The app terminated because that is what I wanted it to do. I phrased the question poorly. The question is why did the licensing fail when I installed the key and code exactly as described by Corona?

I build the app - no errors. I move it via a usb cable to my test android device. It installs. When ran it briefly shows a screen and exits - indicating that the license was not verified.

And yes, it installs and operates fine with the licensing code removed.

main.lua:

-- Google Licensing local licensing = require( "licensing" ) licensing.init( "google" ) local function licensingListener( event ) local verified = event.isVerified if not event.isVerified then --failed verify app from the play store, we print a message print( "Pirates: Walk the Plank!!!" ) native.requestExit() --assuming this is how we handle pirates end end licensing.verify( licensingListener );

config.lua:

license = { google = { key = "my long key without spaces", policy = "serverManaged", }, },

Have you set yourself up as a test user in the Google Play Developer Console?  If not, then Google is providing you the correct licensing response.  It’s saying your installation is unlicensed because it wasn’t installed from Google Play, which is true, because it was installed from your computer.

In the Google Play Developer Console, you can register yourself (via the email address associated with your Google Account) as a test user.  When you do this, you can choose what license response you want to receive to test out your integration.

  • Andrew

Thanks aukStudios. I’ll try registering with my email address. I did try with a Google + and a Google Groups account but it wouldn’t take it. I’ll give the email address a try next time.

Hi,

Do you have some sample code of what you did?  The licensing module doesn’t terminate the app if it fails on itself so I’m at a bit of a loss.

The app terminated because that is what I wanted it to do. I phrased the question poorly. The question is why did the licensing fail when I installed the key and code exactly as described by Corona?

I build the app - no errors. I move it via a usb cable to my test android device. It installs. When ran it briefly shows a screen and exits - indicating that the license was not verified.

And yes, it installs and operates fine with the licensing code removed.

main.lua:

-- Google Licensing local licensing = require( "licensing" ) licensing.init( "google" ) local function licensingListener( event ) local verified = event.isVerified if not event.isVerified then --failed verify app from the play store, we print a message print( "Pirates: Walk the Plank!!!" ) native.requestExit() --assuming this is how we handle pirates end end licensing.verify( licensingListener );

config.lua:

license = { google = { key = "my long key without spaces", policy = "serverManaged", }, },

Have you set yourself up as a test user in the Google Play Developer Console?  If not, then Google is providing you the correct licensing response.  It’s saying your installation is unlicensed because it wasn’t installed from Google Play, which is true, because it was installed from your computer.

In the Google Play Developer Console, you can register yourself (via the email address associated with your Google Account) as a test user.  When you do this, you can choose what license response you want to receive to test out your integration.

  • Andrew

Thanks aukStudios. I’ll try registering with my email address. I did try with a Google + and a Google Groups account but it wouldn’t take it. I’ll give the email address a try next time.