Google Play License sometimes failed?

Hi,

I got a few users contacting me or leaving a review that the game doesn’t work due to the license not verified.

Usually I ask them to try again and it worked.

My code is very lenient, only a event.isVerified = false will trigger the error alert:

----------------------------------- --build.setting "com.android.vending.CHECK\_LICENSE", ----------------------------------- --config.lua license = { google = { -- The "key" value is obtained from Google key = "the long long key", policy = "serverManaged" }, }, ----------------------------------- --Main.lua if \_G.platform == "Android" then licensing = require( "licensing" ) licensing.init( "google" ) end ----------------------------------- --Main2.lua --LICENCE if \_G.platform == "Android" then local function licensingListener( event ) if event and (not event.isError) and (not event.isVerified) then local function onComplete2( event ) if "clicked" == event.action then native.requestExit() end end --alertPop = native.showAlert( "Error", "License Invalid.\nDownload from Google Play Store.", { "OK" }, onComplete2 ) local function onComplete3( event ) native.requestExit() end timer.performWithDelay(5000, onComplete3); end end licensing.verify( licensingListener ) end

I suspect it is the googleplay store’s fault, maybe the licensing takes some time to process so when user pay and download the game it is not licensed yet? 

Also I noticed I got the angry emails every time after I updated the game(but resolved after they tried again), not sure if it is related.

ps. for expansion files, if I use old expansion files instead of submitting new ones, does all the lua files including those in sub folders are updated?

Thanks in advance.

This is a Google issue happens in native java applications as well, and there are a ton of reasons that can fire a false positive like wifi, cell connection, security settings, rooted device etc. and so forth.

While you can check the license every time they open your app it is normally best (from experience) that once they have been validated as coming from google play to flip a flag in your db or whatever you are using and then just bypass the license check the next time they open if it has already validated.

The other thing I have done to make things easier is put in a conditional license count so every time it fails (if not already validated) i increase a license fail count if it is > 3 then I show the warning and exit and set some other flags.

With every update it has to cycle through the google cdn of servers then update the license on their server with the new hash which is why you are seeing it on updates. So by putting in the logic above you will avoid all those issues.

Not sure if that helps or not but maybe some ideas :slight_smile:

Thank you very much for the explanation. I thought those problems will return errors but it returns Not Licensed.

I understand the each validate last for 24 hours, so only those new downloads are affected.

I will implement the 3 times check in next update. Hopefully it will reduce the number of unhappy new buyers. 

Thank you.

Just an update of the status.

My code is lenient,  allows all kinds of errors except when googlePlay returns  event.isVerified = false 

I also added a 3 times check as recommended by Christopher: Only when licence failed for 3 times the licence notification will pop up.

On top of that, I added a 12 hour Timer: For the first 12 hour from the player opens the game, it will never pop up the licence failed notification.

For the last 16 days, I only received 1 failed licence complain. So I think this is a good set up!

There are many other issues with GooglePlay Store:

Buyers cannot download the game after purchase

Buyers cannot download the expansion files

Buyers bought the game but still appear as not purchased on the Store(when attempt to purchase again it fails)

Unable to update to latest version

The usual recommendation I gave is to wait for sometime, then restart the phone and re-install the game, if still not solved, try clear googlePlay Store cache. It solves most of the problems.

I am not sure how easy it is to crack googlePlay licence check. Maybe I will add a check with flurry on next update to track the number of failed licence check.

This is a Google issue happens in native java applications as well, and there are a ton of reasons that can fire a false positive like wifi, cell connection, security settings, rooted device etc. and so forth.

While you can check the license every time they open your app it is normally best (from experience) that once they have been validated as coming from google play to flip a flag in your db or whatever you are using and then just bypass the license check the next time they open if it has already validated.

The other thing I have done to make things easier is put in a conditional license count so every time it fails (if not already validated) i increase a license fail count if it is > 3 then I show the warning and exit and set some other flags.

With every update it has to cycle through the google cdn of servers then update the license on their server with the new hash which is why you are seeing it on updates. So by putting in the logic above you will avoid all those issues.

Not sure if that helps or not but maybe some ideas :slight_smile:

Thank you very much for the explanation. I thought those problems will return errors but it returns Not Licensed.

I understand the each validate last for 24 hours, so only those new downloads are affected.

I will implement the 3 times check in next update. Hopefully it will reduce the number of unhappy new buyers. 

Thank you.

Just an update of the status.

My code is lenient,  allows all kinds of errors except when googlePlay returns  event.isVerified = false 

I also added a 3 times check as recommended by Christopher: Only when licence failed for 3 times the licence notification will pop up.

On top of that, I added a 12 hour Timer: For the first 12 hour from the player opens the game, it will never pop up the licence failed notification.

For the last 16 days, I only received 1 failed licence complain. So I think this is a good set up!

There are many other issues with GooglePlay Store:

Buyers cannot download the game after purchase

Buyers cannot download the expansion files

Buyers bought the game but still appear as not purchased on the Store(when attempt to purchase again it fails)

Unable to update to latest version

The usual recommendation I gave is to wait for sometime, then restart the phone and re-install the game, if still not solved, try clear googlePlay Store cache. It solves most of the problems.

I am not sure how easy it is to crack googlePlay licence check. Maybe I will add a check with flurry on next update to track the number of failed licence check.