Search code examples
androidin-app-billing

Android in-app Billing with multiple users on one device


I have an application which supports in-app billing. However a user can login to this app using multiple accounts or he can even register a new account.

Can I somehow use in-app billing, so that the purchases would be linked not to the google id, but exactly to the account which made the purchase.

For example:

  1. User downloads the app to his phone and does the actions described below only on this device.
  2. User logins using 123@gmail.com account.
  3. He purchases subscription1 and proceeds with the payment.
  4. He logs out.
  5. Now he logins using 456@gmail.com account.
  6. He can also purchase subscription1, as 456@gmail.com never purchased it. So he purchases subscription1 one more time.
  7. He logs out.
  8. Now both 123@gmail.com and 456@gmail.com accounts own this subscription.
  9. Profit.

Solution

  • In-app-billing works through google services and all purchases will be verified for a current user. Starting from Android 4.2 you can create multiple user profiles on one device and in-app-billing will work as you described.

    You may just log out/in but it takes time to synchronize some information and you may experience some glitches.