Search code examples
androidmobilein-app-purchasegoogle-playin-app-billing

Google Play in-app billing giving an item for free


I already have a completely free app published at Google Play store.

Since the app is more popular than I have thought, I decided to lock some of the features and demand in-app billing before using it. However, I prefer that all existing users will continue to enjoy have the premium features for free.

So, I thought about the following:

  • Upload a version with in-app billing for free, so that the existing users will "purchase" it for free.
  • After certain amount of time start charging for the items, but since he existing users already own the premium items they wouldn't be hurt.

Is there a way to grant some users an item for "free"? In the In-App billing documentation is written that there must be a price for all in-app billing items.


Solution

  • There is no direct way to do it from google. You will be having 2 test-cases:-

    1. Existing user
    2. New user You have to store unique user-id on your server and when you implement your in-App in application send this user-id to your server.

    Case 1:- Your server will match it with existing DB if it matches the id return you success message.

    Case 2:- For new users along with this user-id your app should send purchase token to your server for verification and after verifying the purchase your server should send success message.

    Common task:- When your application starts you should always call restoreTransaction() after that you will get a list from google contains information about already purchased items and you will unlock that content. Make sure you have server verification implementation in you app.