ARP
ARP

Reputation: 613

What is the use of Application public key in In App billing in android

I Am new to the concept of InApp billing, I’ve gone thorough the sample application provided in Android developer site, I've observed that they are using Application public key(base64string), could someone explain me what is the use of public key? I Am able to do purchase without using public key.

Upvotes: 2

Views: 4216

Answers (2)

Hadi tavakoli
Hadi tavakoli

Reputation: 1317

This base64 public key is only used when you want to verify a purchase legitimacy in your app. you may use it in combination of the purchase getOriginalJson() and purchase.signature. However, verifying a purchase on the app is not recommended. Google says:

Warning: This form of verification isn't truly secure because it requires you to bundle purchase verification logic within your app. This logic becomes compromised if your app is reverse-engineered.

The better way to verify purchases is to use that public key on your server. You may read more information about that here: https://developer.android.com/google/play/billing/billing_library_overview#Verify-purchase

Upvotes: 0

Adam
Adam

Reputation: 2570

It has to do with licensing. Here is a link to Android Developers that talks about it. The key inhibits unlicensed versions of your app from being distributed.

Upvotes: 1

Related Questions