How to cache Licensing Responses with ServerManagedPolicy

  • Replies:4
Robert Scott
  • Forum posts: 3

Mar 5, 2019, 12:28:51 AM via Website

I have just started testing the Licensing Verification Library. I followed the pattern of the lvl_sample from Google, but the responses are not being cached. After doing a mChecker.checkAccess(mLicenseCheckerCallback) and getting a "LICENSED" response, I turned off wifi and tried it again, expecting to get the same response from the cache. But I got a dontAllow response with policy reason of Policy.RETRY. How can I get these responses cached?

Reply
James Watson
  • Forum posts: 1,584

Mar 5, 2019, 4:00:12 AM via Website

I think you couldn't get the response cached just in your code. Try to check if there is any setting options in 'Settings - Google' of an Android device.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Robert Scott
  • Forum posts: 3

Mar 5, 2019, 4:24:55 AM via Website

I'm trying to implement Licensing in the app I am developing. It has to work on every customer's device, regardless of their personal Settings/Google.

Helpful?
Reply
Robert Scott
  • Forum posts: 3

Mar 5, 2019, 5:20:20 AM via Website

OK, caching problem has been solved. It turns out that internal testing accounts expire the cache after 1 minute. I tried it out and sure enough, the license check returns LICENSED for one minute after wifi is turned off.

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Mar 5, 2019, 3:18:46 PM via Website

Okay, I see. The good news is that your problem has been solved.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply