When what I gather from the deocumentation using the serverManaged policy for google licensing should act like the ServerManagedPolicy Google has. IE: The licensing check should cache the results so that a user can use the app a few times without a internet connection.
I believe this used to work, but I just received a message from a user saying he can’t use my app after updating to the latest version because he does not get data in his machine shop.
Code:
application = { content = { width = 320, height = 570, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, license = { google = { key = "MY LICENSING KEY IS HERE", policy = "serverManaged", }, }, }
if not device.isApple then licensing.init( "google" ) local function alertListener ( event ) if "clicked" == event.action then local i = event.index if i == 1 then native.requestExit() end end end local function licensingListener( event ) local verified = event.isVerified if not event.isVerified then --failed verify app from the play store, we print a message native.showAlert ( "Could Not Authorize", "There was a problem contacting the Google licensing servers. Please check internet connection and try again.", { "Close" }, alertListener) else composer.gotoScene( "menu") end end licensing.verify( licensingListener ) end print(system.getInfo("model") .. " " .. system.getInfo("platformVersion")) if device.isApple then composer.gotoScene( "menu") end
I just tested it myself. My app opens fine with a network connection. However, if I turn WiFi off the app always returns a licensing failed response. Shouldn’t it be caching the results?