Tony
Tony

Reputation: 85

Native Android Inapp Purchase Where to Configure Base64-encoded RSA License Key?

I am implementing inapp purchase in my native android app. I am following code same as given at https://developer.android.com/google/play/billing/billing_library_overview . But where I want to configure the Base64-encoded RSA License key? This reference not specifies about this configuration. Could anybody please help me?

Thanks

Upvotes: 3

Views: 1503

Answers (2)

Mark S. Khalil
Mark S. Khalil

Reputation: 157

for old playconsole To get key go to Developer Console > Select your app > Development Tools > Services & APIs. for new play console To get key go to Developer Console > Select your app > Monetize > Monetization setup

Upvotes: 1

daedsidog
daedsidog

Reputation: 1773

Whenever you initialise in-app billing, you have to supply the constructor with an encoded public key that is associated with your GP Console account:

mHelper = new IabHelper(this, base64EncodedPublicKey);

If you would try to run your app without doing this, you would get a warning telling you to change the default value of base64EncodedPublicKey, assuming you are using the demo examples available from Google.

It's also good practice to do the best you can to obfuscate your code using things like ProGuard.

EDIT: It looks like this is a newer method of implementing billing than what I used. From what I can understand it seems that you can optionally use the key using the getOriginalJSON() method to verity a purchase, but it is not used in the sample code so I can only assume it isn't mandatory.

Upvotes: 0

Related Questions