In app billing - handling IN_APP_NOTIFY
I'm implementing in-app billing for androi开发者_运维知识库d and I had a question about handling the IN_APP_NOTIFY intent. Is there a way to determine what original request triggered this intent? As an example, if I send multiple requests to the Market service, how would my BroadcastReceiver know which request triggered the intent?
Thanks
Shravan
It seems that you can use NotificationID to keep track of the different intents. See http://developer.android.com/guide/market/billing/billing_reference.html for more details.
I think I have the same problem: when a user initiates a purchase in my app, I want to be able to tell whether a received IN_APP_NOTIFY was triggered by that particular purchase or if it was triggered by a previous unconfirmed transaction. IN_APP_NOTIFY's notification_id field is useless for that matter, and IN_APP_NOTIFY doesn't provide us with the request_id field that would be useful. Even the data received from PURCHASE_STATE_CHANGED does not allow to know for sure that a particular initiated purchase has been fully processed by the Android Market. One could try to generate some kind of unique token at purchase time, store it in the developerPayload field at purchase time and then later use it as some kind of a request id when receiving PURCHASE_STATE_CHANGED.
精彩评论