Quick Links: Gideros Home | Download Gideros | Developer Guide
Checking app store for ownership of premium version
  • PaulH +1 -1
    Member
    Hey, all. Does anyone have a premium (paid) app made with Gideros check with the app store to confirm the user owns it? In a non-Gideros app for Android I use com.google.android.vending.licensing.LicenseChecker. You create a LicenseChecker, give it a callback class and the public key for the app from the Google developer console, and lets you know if the user actually owns the app. That's useful because you can then make your premium app recognize when it's not owned (installed from a pirated APK) and act like the free version of the app.

    Does anyone do anything similar with a Gideros app? I'm experimenting with adding the license checker to the main activity exported by Gideros, but I don't want to risk introducing conflicts with the in-app billing plugin.

    Paul
  • antixantix +1 -1
    Member
    I have wondered about this myself. This kind of functionality would be a great addition to Gideros ;)
  • PaulH +1 -1
    Member
    I'm still experimenting, but it looks promising. Adding the licensing library to the exported project, and adding some code to onCreate in the main activity, the LicenseChecker is running. I'm having it write its results in a file in data/data/appname/files/, the Android folder equivalent to "|D|" in Gideros, so the Lua code can see the results without adding all the layers required to make a plugin. The license checker isn't getting me the expected result yet, but I'm guessing that may be because the APK I'm testing isn't a version the store has seen. I'm publishing to beta in Google Play in the hopes that the license checker will report back correctly if the app was actually installed through the store.
  • SinisterSoftSinisterSoft +1 -1 (+1 / -0 )
    Maintainer
    "Google Play offers a licensing service that lets you enforce licensing policies for applications that you publish on Google Play. With Google Play Licensing, your application can query Google Play at run time to obtain the licensing status for the current user, then allow or disallow further use as appropriate.
    This is the plugin to implement the querying and verification process.
    Additional this plugin performs needed checks for downloading expansion files and handles its downloads."

    http://giderosmobile.com/labs/google-licensing

    Likes: antix

  • SinisterSoftSinisterSoft +1 -1
    Maintainer
    I just looked and the google licensing plugin should be in the list of available plugins - but it isn't... hopefully this will be fixed for the 2017.4 version.
  • keszegh +1 -1
    Member
    @sinistersoft, this plugin shows as a premium feature, this sign should be removed.
  • SinisterSoftSinisterSoft +1 -1 (+1 / -0 )
    Maintainer Accepted Answer
    Yes.

    I'm still looking into why it's not in the list of export plugins, it should be there as there is a gplugin for it.

    When it does appear, this is how you use it:
    pcall(function() require "googlelicensing" end)
    if googlelicencing then
    googlelicencing:setKey(googleLicence)
     
    googlelicensing:addEventListener(Event.LICENSE_ALLOWED,function()
    print("License verified")
    end)
     
    googlelicensing:addEventListener(Event.LICENSE_DENIED,function()
    print("License denied")
    end)
     
    googlelicensing:addEventListener(Event.LICENSE_RETRY,function()
    print("Unable to verify licence")
    end)
     
    googlelicensing:addEventListener(Event.DOWNLOAD_REQUIRED,function()
    print("Download required")
    end)
     
    googlelicensing:addEventListener(Event.DOWNLOAD_NOT_REQUIRED,function()
    print("Download not required")
    end)
     
    googlelicensing:addEventListener(Event.DOWNLOAD_STATE,function(e)
    print("Download state:",e.state,e.message)
    end)
     
    googlelicensing:addEventListener(Event.DOWNLOAD_PROGRESS,function(e)
    print("Download progress",e.speed,e.timeLeft,e.progress,e.total)
    end)
     
    googlelicensing:addEventListener(Event.ERROR,function(e)
    print("Licence/Download error:",e.error)
    end)
     
    googlelicensing:checkLicense()
    --googlelicensing:checkExpansion() -- check for license
    --googlelicensing:cellularDownload(true)
    else
    print("Licensing unavailable")
    end

    Likes: antix

  • SinisterSoftSinisterSoft +1 -1
    Maintainer
    You can find the licence id in the google play store backend, look in the 'Services & APIs' section.

    It's the "Base64-encoded RSA public key".

    The same code is used for IAB, so if you use that the maybe you should set the key to a string and use that same string for both api calls.
  • antixantix +1 -1
    Member
    Looking forward to trying this out :)
  • PaulH +1 -1 (+1 / -0 )
    Member
    Good to know. Thank you! My experimental addition of the LicenseChecker to the main activity worked as well. I'd be happy to share the code I used, but it looks like it will be easier for people to just use this plugin.

    Thanks again,

    Paul

    Likes: antix

  • antixantix +1 -1
    Member
    Thanks @PaulH but yes I'd rather use the plug-in system. If I never have to use Android Studio again I'll be really happy :)

    Of course I still have to use it to dump logcat stuff :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID

In this Discussion

Top Posters