5

When using in-app billing with Google Play you receive a PURCHASE_STATE_CHANGED broadcast intent containing information about the purchase. At that point you

  1. Verify the purchase (possibly on your own server)
  2. Record the purchase (almost certainly on your own server if its an unmanaged item)
  3. Update your app to reflect the purchase

My question is: When recording the purchase on your own server what user identity should be used to collate multiple purchases (and uses) of an unmanaged item? And how do you get this identity on Android?

NB the identity can't be device specific because a user may have more than one device. It needs to be linked to the Google Play account used for purchase. The data in the intents coming back from Google Play don't seem to contain any user identity (obfuscated or not).

I'm looking for where/how to find the Google play identity on Android and how to send that to an AppEngine stance.

William
  • 20,150
  • 8
  • 49
  • 91
  • It's quite a while ago, but I do have the same problem for which I haven't found a solution yet: Did you solve this problem and how? – infero Feb 05 '15 at 10:54
  • Use Google Play Services and the GET_ACCOUNTS permission. It's the only way to do it. Users are not as freaked by that permission now that they are starting to get some understanding of what it means. – William Feb 05 '15 at 23:32
  • Android 6.0 Marshmallow has runtime permissions and GET_ACCOUNTS is grouped into "dangerous permissions". So does that mean you have to ask the user for that permission when user tries to make a purchase? – Amit Jayant Oct 13 '15 at 13:57

1 Answers1

1

I saw your discussion on Google Groups, from a few months ago when Google Play Services was not yet released.

You can now use Google Play Services as a standard way to do this. See AccountPicker.

TalkLittle
  • 8,866
  • 6
  • 54
  • 51
  • Yeah I'd been following Google Play Services for a while hoping this was going to be the answer, but it requires the GET_ACCOUNTS permission which I really don't want to add becaise it freaks users out. I don't need access to their account I just need a unique identifier within my app. Something that In App Billing should easily be able to provide. – William Feb 08 '13 at 23:59