mattleibow / Android.Play.ExpansionLibrary

MOVED to xamarin/XamarinComponents
https://github.com/xamarin/XamarinComponents/tree/master/Android/GoogleAndroidVending
21 stars 17 forks source link

Response codes may be wrong #22

Open rickrvo opened 7 years ago

rickrvo commented 7 years ago

I'm developing a app using xamarin and your plug-in for Google Licensing. And I can't get it to work... I set 3 testers to reply licenced in the developer console ( including myself ) and on those accounts I get NotLicenced response... Even logged in with my publisher account.

this is the code I'm using:

bool internet = Task.Run(CheckNET).Result;

// Construct the LicenseChecker with a policy. var obfuscator = new AesObfuscator(Salt, this.PackageName, Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)); var policy = new ServerManagedPolicy(this, obfuscator); this.checker = new LicenseChecker(this, policy, "Here is my API public key");

if (internet) { checker.CheckAccess(this); }

I've fixed all application error messages in within the first tries (permissions and then NotMarketManaged) and now I'm stuck getting NotLicensed...

So the communication is working, just the License response isn't comming back as it should be for the emails listed in License Testing.

So.. with more testing it a bit strange... I've set ERROR_NON_MATCHING_UID as default response for testers and it did reply that exact error.... but when I changed back to Licensed I got NOT_LICENSED response...

After that it got way stranger... I've played a bit with the response options and this is what responses I got from Google Licensing server:

Google Console set to: -> Server Response:

Licensed -> Not_licensed Licensed_old_Key -> Not_Licensed Not_Licensed -> Not_licensed Error_server_failuere -> LICENSED Error_contacting_server -> Licensed Error_invalid_packagename -> InvalidPackageName error_nonmatching_uid -> NonMatchingUid

so... can anyone explain what is going on? Could the plugin be analysing the codes wrongly?

I've checked the plugin code and this is what I found that it is using these response codes:

Licensed = 0x0, NotLicensed = 0x1, LicensedOldKey = 0x2, NotMarketManaged = 0x3, ServerFailure = 0x4, OverQuota = 0x5, ErrorContactingServer = 0x101, InvalidPackageName = 0x102, NonMatchingUid = 0x103

can anyone confirm if these are the correct codes that Google Licensing replies?

AnbalaganD commented 7 years ago

I am also face same issue. @rickrvo, do you have any idea how to fix it?.

mattleibow commented 7 years ago

This is tough to test, but you have to make sure that the app is published (just to alpha), and then you have to download the app at least once from the store.