Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: get Google Play account associated with in-app billing

How can I get the email/ID of the Google Play account associated with an app?

I need this to show the user which account is taken into consideration for in-app billing. As far as I understood, Google in-app billing uses the account which downloaded the app, but I need to find a way to display this to the user, in case he has more than one account configured.

This would prevent users to complain not having their purchases recognized, when they have another account associated with the app.

like image 350
Daniele B Avatar asked Jul 21 '14 10:07

Daniele B


People also ask

How do I use a different Google Play account for in-app purchases?

Choose "Accounts & Sync". You should see something that says "Manage Accounts." This screen lets you add and remove accounts. If it's not already in the list, add the account that you originally used to make the purchase.

How do I check my Google Play Billing Library?

To test your Google Play Billing Library integration using test tracks, do the following: Publish your app to a test track. Note that after you publish an app to a testing track, it can take a few hours for the app to be available for testers. Ensure each tester opts-in to your app's test.

What is Google Play in-app billing?

Google Play's billing system is a service that enables you to sell digital products and content in your Android app. You can use Google Play's billing system to sell a one-time product or subscriptions on a recurring basis.


1 Answers

Actually is not possible to get from Google Play the account that downloaded the application. The suggestion is to create your own application user's account and only allow purchases after user registration (you can use whatever method you want to use).

And, for each purchase you link in your backed to the user's account. And, if the users log into another device using another Google account, if he log into your application using the right account, the access will be granted.

Google Play team is aware that this is not the best solution, and as I commented on this question, we are improving the API and as soon as we have an update, I'll post here too.

like image 198
Neto Marin Avatar answered Oct 02 '22 22:10

Neto Marin