Android Market In-App Billing IN_APP_NOTIFY Response
I'm trying to understand the In-App Billing documentation for Android, specifically the IN_APP_NOTIFIY response. Looking at the reference, it reads as followings
com.android.vending.billing.IN_APP_NOTIFY
This response indicates that a purchase has changed state, which means a purchase succeeded, was canceled, or was refunded. This response contains one or开发者_StackOverflow社区 more notification IDs. Each notification ID corresponds to a specific server-side message, and each messages contains information about one or more transactions. After your application receives an IN_APP_NOTIFY broadcast intent, you send a GET_PURCHASE_INFORMATION request with the notification IDs to retrieve the message details. The sample application assigns this broadcast intent to a constant named ACTION_NOTIFY.
Extras
notification_id—a String representing the notification ID for a given purchase state change. Android Market notifies you when there is a purchase state change and the notification includes a unique notification ID. To get the details of the purchase state change, you send the notification ID with the GET_PURCHASE_INFORMATION request.
How do I get multiple notification IDs when the response is only a string? How do I take care of the multiple notifications case?
It seems that the google documentation is indeed wrong. Maybe the guy who wrote the excerpt got confused with the fact that "Google Play may send repeated IN_APP_NOTIFY intents for a PURCHASE_STATE_CHANGED message even though your application has sent a CONFIRM_NOTIFICATIONS message." as can be read here: http://developer.android.com/guide/google/play/billing/billing_overview.html#billing-action-notify
That means that you should be able to handle multiple IN_APP_NOTIFY intents, but one IN_APP_NOTIFY intents contains only one notification ID. Another possibility is that the guy who wrote the documentation got confused with the fact that you can send an array of notification IDs when making a request of the type GET_PURCHASE_INFORMATION as exposed in the section "Retrieving transaction information for a purchase or refund (GET_PURCHASE_INFORMATION)" in the doc: http://developer.android.com/guide/google/play/billing/billing_integrate.html
精彩评论