Get the Google ID used in an in-app billing purchase
Asked Answered
S

2

15

It has come to my attention that a device may have multiple Google accounts logged into it simultaneously. I understand that pre-Honeycomb, there is a primary ID; from Honeycomb on you can simply plug in several. I currently have two IDs logged into my test tablet.

When purchasing from Google Play you can choose which account is used to make a purchase. I want to add in-app billing to an application I'm writing, and I want to make sure each Google ID gets its purchases on any device, which means I need to know which ID was used to make the purchase in the first place. This means I need to do one of the following:

  1. Force Google Play to use one of the Google IDs chosen from within my app by the user;
  2. Retrieve the ID that Google Play used to make the purchase.

The documentation seems to have been written with the assumption that only one purchaser would ever be active on one device. Is it possible to do this?

Suspend answered 20/3, 2012 at 18:12 Comment(0)
K
2

This seems to be an issue with the Google PlayStore application. The same has been reported at

https://code.google.com/p/marketbilling/issues/detail?id=76

Kaczmarek answered 9/4, 2013 at 15:37 Comment(2)
Right. Although it's worth to note that this report is probably related to version 2 of in-app billing.Constriction
I have tried version 3 of IAB and found the issue to be persisting.Kaczmarek
R
1

I guess the app will be tied to the google account you used to download the application.You might have to use the same google id to make the purchase. Otherwise, restore of purchases could be an issue.

Reggi answered 20/3, 2012 at 18:16 Comment(2)
You may well be right. I hadn't thought of this. It does simplify things quite a lot, potentially.Suspend
This does beg the question: how do you find out which google account downloaded the app?Suspend

© 2022 - 2024 — McMap. All rights reserved.