문제

In my attempts to understand the In-app Billing flow, I ran the market_billing sample, as is, plus a few Log.v() in key points, like in BillingService.handleCommand():

public void handleCommand(Intent intent, int startId) {
    String action = intent.getAction();
    if (Consts.DEBUG) {
        Log.i(TAG, "handleCommand() action: " + action);
    }
    if (Consts.ACTION_CONFIRM_NOTIFICATION.equals(action)) {
        String[] notifyIds = intent.getStringArrayExtra(Consts.NOTIFICATION_ID);
        confirmNotifications(startId, notifyIds);
    } else if (Consts.ACTION_GET_PURCHASE_INFORMATION.equals(action)) {
        String notifyId = intent.getStringExtra(Consts.NOTIFICATION_ID);
        getPurchaseInformation(startId, new String[] { notifyId });
    } else if (Consts.ACTION_PURCHASE_STATE_CHANGED.equals(action)) {
        String signedData = intent.getStringExtra(Consts.INAPP_SIGNED_DATA);
        String signature = intent.getStringExtra(Consts.INAPP_SIGNATURE);
        purchaseStateChanged(startId, signedData, signature);
    } else if (Consts.ACTION_RESPONSE_CODE.equals(action)) {
        long requestId = intent.getLongExtra(Consts.INAPP_REQUEST_ID, -1);
        int responseCodeIndex = intent.getIntExtra(Consts.INAPP_RESPONSE_CODE,
                ResponseCode.RESULT_ERROR.ordinal());
        ResponseCode responseCode = ResponseCode.valueOf(responseCodeIndex);
        checkResponseCode(requestId, responseCode);
    }
}

My problem (?) is that I can see in the logs all actions being performed, but ACTION_CONFIRM_NOTIFICATION never shows up for some reason, despite the transaction being successful.

Any idea why this is?

What am I missing?

도움이 되었습니까?

해결책

ACTION_CONFIRM_NOTIFICATION is never used in BillingReceiver and I have no idea why they declare it in handleCommand as CONFIRM_NOTIFICATION should not be done here in the first place

다른 팁

The BillingReceiver is waiting for the IN_APP_NOTIFY message sent from the market. Then it would start the confirmation through the service. Does your receiver receive the IN_APP_NOTIFY message?

I have a similar issue too. My application does never get back the notification from the Market application. So there's actually nothing to confirm for your app. It seems like it is a known issue for a long time already as you can see here: http://code.google.com/p/marketbilling/issues/detail?id=14

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top