5
votes

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.

1
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
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
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

1 Answers

1
votes

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.