The corona community is great in letting you know how to build an app with corona but when it comes to the point where Corona meets Google Play it seems like information is scarce. At least from what I’ve seen. I’ve been searching all over the place and the whole process from the end of development to the point when your app is actually on Google Play doesn’t seem to be covered well.
I believe my issue is my app is not being verified. I just don’t understand how the whole process works. I have the proper code, copied directly from the Androidizing your mobile app tutorial. My App ID is in the proper place and looks to be correct. I gleaned from a forum post that you have to upload your apk to google play in order for it to properly verify (which, as far as I can tell, is not in any tutorial or guide), which I did.
I just think I’m missing some sort of technicality that isn’t expressly stated anywhere, or maybe I need to adapt the licensing code to my app? Either way I’ll give what shoots out from adb
logcat Corona:v *:s
V/Corona (29495): > Class.forName: network.LuaLoader
V/Corona (29495): < Class.forName: network.LuaLoader
V/Corona (29495): Loading via reflection: network.LuaLoader
I/Corona (29495): Platform: Nexus 7 / ARM Neon / 4.4.2 / NVIDIA Tegra 3 / OpenG
L ES 2.0 14.01003
V/Corona (29495): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (29495): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (29495): Loading via reflection: CoronaProvider.licensing.google.LuaLo
ader
I/Corona (29495): WARNING: licensing.init() was already called for google.
I/Corona (29495): Pirates: Walk the Plank!!!
I’ll give my code as well.
In config.lua:
application = { license = { google = { key = "the really long string you copied from Google Play", policy = "serverManaged", }, }, }
In build.settings
android = { usesPermissions = { "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "com.android.vending.BILLING", }, }
In main.lua
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 )
Until I added these the app worked fine on my device, now it’s closing out as soon as it opens. I assume that’s what the native.requestExit() does after failing verification.