Have been trying to get a response back from “licensing.verify” to no success. I just noted however that my licensing.init(“google”) is returning false.
Question - Any ideas why this would be the case & how to fault find.
The code I’m using is here. When I run this on my Android compiled code, and have uploaded an APK to google plan (not released), I get the “NotAttempted-InitFailed” response.
local function finishedFunction(displayObject, text) displayObject.text = text end local infoString = "About to Call Google Play. " local text = display.newText(infoString, 0, 0, display.contentWidth, display.contentHeight, native.systemFont, 12 ) text:setTextColor(255, 0, 0) local device = require("lib.device") if device.isGoogle then local licensing = require( "licensing" ) local initResult = licensing.init( "google" ) -- \*\* RETURNS FALSE HERE \*\*\* if initResult then local function licensingListener( event ) local verified = event.isVerified if not event.isVerified then infoString = infoString .. "\nOnGoogle: License Check: FAILED, " .. event.response .. ", " .. event.errorType native.requestExit() --assuming this is how we handle pirates else infoString = infoString .. "\nOnGoogle: License Check:PASSED" end finishedFunction(text, infoString) end licensing.verify( licensingListener ) else infoString = infoString .. "\nGooglePlayLicenseCheck-NotAttempted-InitFailed" end else if device.isAndroid then infoString = infoString .. "\nNOT On Google, but still an Android device" else infoString = infoString .. "\nGooglePlayLicenseCheck-NotAttempted-NotAndroid" end finishedFunction(text, infoString) end -- Just to show me the app is still running timer.performWithDelay( 2000, function(event) infoString = infoString.."." finishedFunction(text, infoString) end, 0)
