Has anyone gotten the Google Play licensing stuff to work consistently?
I just added the Google Play licensing code, and I tried testing on a device.
This is the listener code I am using, based on the sample code:
function licensingListener( event ) local verified = event.isVerified message = "Address: " .. event.address .. "\n\nName: " .. event.name .. "\n\nProvider: " .. event.provider .. "\n\nisVerified: " .. event.isVerified .. "\n\nisError: " .. event.isError .. "\n\nError type: " .. event.errorType .. "\n\nError response: " .. event.response native.showAlert( "App Name", message, { "OK" }, exitApp ) end
I never get an alert, regardless of what I set the License Test Response to in the Google Play Developer tool for my account.
If I use this listener code:
local function licensingListener( event ) local verified = event.isVerified if not event.isVerified then native.showAlert( "App Name", "Error type: " .. event.errorType .. "\n\nError response: " .. event.response, { "OK" }, exitApp ) end end
In the Google Play developer tool, if I set my account to get a License Test Response of NOT_LICENSED, I never get an alert.
If I change it to ERROR_SERVER_FAILURE, I do get an alert. If I change it to any of the other ERROR_XXX options, I do get an alert. Why is there no alert if the License Test Response is sent as NOT_LICENSED?
How can one actually check that that the response was NOT_LICENSED and not one of the other possible errors that might cause the user to not be verified?