I’m trying to implement a feature to update my server side database when someone purchases a managed item in my Android application.
Basically I want the user to be able to log on to my website when the managed item have been purchased but not before.
Can someone please provide me with details on how to accomplish this.
Someone I would like to send a username/email or similar to the web page that I can use to update the server database. However I need to make sure this cannot be sent by a user that have not purchased the managed item in my Android application
I have read some good post on this subject, but I still don’t see how I can apply this in my solution
- How do I verify Android In-app Billing with a server with Ruby?
- http://crazyviraj.blogspot.se/2011/06/some-notes-on-implementing-in-app.html
Best regards
Google play store sends signed data and signature of each individual purchase. On successful purchase of an item from your android application, the application needs to send in the signed data and signature to your server. This data then needs to be verified against the public key. On successful verification, you can then intimate the android application with the success response and the required credentials for him to login.
EDIT :
Android Inapp Billing Overview
Sample Inapp Billing
Sample BroadcastReceiver
Please check the android sample inapp billing implementation. That has a dungeon’s example which implements inapp billing. You need to implement a BroadcastReceiver which gets the data back from GooglePlay. com.android.vending.billing.PURCHASE_STATE_CHANGED intent represents that a purchase has happened. Now you can get the signed data and signature from the intent like
Now you may need to pass in this data to your server to identify the user who actually purchased it. Hope it helps.