Reputation: 7904
I've got an Android app (HTML5 app using PhoneGap) that I want to test with Android's LVL verification.
I've exported my app pkg from Eclipse, uploaded it to Google Play without actually publishing it, and installed the same pkg to my Android phone. When I go to Edit profile > Set license test response, it doesn't matter what I pick, the app on the phone always gets the "LICENSED" response.
The device and the test account are all the same Google account.
When I attach the debugger, the console lists a number of logs from the LicenseChecker,
What on earth could I be doing wrong?
Upvotes: 0
Views: 804
Reputation: 7904
Turns out there's been a bug in an update of the Google Play app. The license checks were timing out, and so in my case the default choice was to allow the user access anyhow.
If you delete the app data for that app, your own test app will reestablish its connection with Google Play and whatever test response you set will almost instantly be the response received by the app on the device.
In fact you don't even need to follow the guidelines about uploading exactly the same pkg to Google Play in order to get these test responses. Just use the same key.
NOTE: In my current setup as above, using the ServerManagedPolicy, the app distinguishes nicely between LICENSED (which triggers Allow()) and UNLICENSED (which triggers DontAllow()). If there is an error, however, the applicationError() callback doesnot handle all codes well, or some of those codes are never provided to it.
ERROR_NOT_MARKET_MANAGED triggers ApplicationError() just fine. But these two errors redirect the app to DontAllow: ERROR_SERVER_FAILURE ERROR_CONTACTING_SERVER
I wish I could catch these errors since they are usually not the user's fault, and yet the user is led to the "You didn't buy this app" dialog.
Upvotes: 1