5

The JSON fields that are returned with a PURCHASE_STATE_CHANGED intent contain very useful information, but one piece that I am interested in is not listed: customer's email address.

Is there a way to retrieve it, using In-App Billing API?

If not, is there a way to retrieve some other unique identifier for the customer, so that a transaction can be associated with the customer, not the device?

Bill The Ape
  • 3,261
  • 25
  • 44

2 Answers2

2

If you are running Android 2.x and up, maybe you can get a way with the owner's email address?

The downside of this is that it requires android.permission.GET_ACCOUNTS in the manifest. The more permissions your apps requires, the more likely you are to scare prospective users of your app...

Also note that "owner's email address" might not be the same as "purchase account email address" (especially since Honeycomb 3.0)

Community
  • 1
  • 1
Regex Rookie
  • 10,432
  • 15
  • 54
  • 88
1

I was struggling to solve this problem too. So what I've come to is using nonce value. Ideally you should generate nonce on the server side prior to sending IN-APP Billing request from your app, so in this case you can connect nonce value to customer's email.

I understand that it's a little bit clunky so if anyone knows better solution I'd like to see it to.

Roman Minenok
  • 9,328
  • 4
  • 26
  • 26
  • Can you elaborate about this `nonce` trick? Pointer to sample code? Thanks +1 for now. – Bill The Ape Jan 08 '12 at 16:35
  • What I meant is you could prior to sending the data to In-App Billing server you could "remember" that this particular fresh node that you are going to send to In-App Purchase server is "connected" to particular customer's email. It is really difficult to explain in further details. BTW consider watching http://www.youtube.com/watch?v=TnSNCXR9fbY video, it's extremely useful and explains some techiques of protection of your in-app purchase processes. – Roman Minenok Jan 08 '12 at 17:44