onPurchaseStateChange从未调用过

时间:2012-04-02 12:03:08

标签: in-app-purchase google-checkout in-app-billing

一旦我在市场上的已签名应用程序中购买了一件商品,就会收取费用,但在消息显示您的商品后很快就会出现任何问题。这意味着,我有一个方法类:

public class CheckoutPurchaseObserver extends PurchaseObserver {

@Override
    public void onPurchaseStateChange(PurchaseState purchaseState,
            String itemId, int quantity, long purchaseTime,
            String developerPayload) {


        if (Consts.DEBUG) {
            Log.i(TAG, "onPurchaseStateChange() itemId: " + itemId + " "
                    + purchaseState);
        }

        if (developerPayload == null) {
            logProductActivity(itemId, purchaseState.toString());
        } else {
            logProductActivity(itemId, purchaseState + "\n\t"
                    + developerPayload);
        }


        Log.d("STATE CHANGED", purchaseState+" item "+itemId+" quantity "+ quantity);

        if (purchaseState.equals(PurchaseState.PURCHASED)) {
            if (itemId=="5_pack"){
                GameMemory.AddCredit(5);
            }
            }

似乎永远不会调用此方法。我在Stackoverflow上看到它可能与security.java中的密钥有关(使用此博客http://mcondev.wordpress.com/2011/06/26/integrate-in-app-billing-just-3-lines-of-code-in-your-app/#comment-74

所以,要么我必须等待很长时间,有人知道Google Play何时会做出反应?或者这个键可能有问题。我从我的发布帐户中的商家帐户复制了密钥,并在与该帐户无关的设备上进行了测试。

发布时我是否必须删除该密钥?

谢谢!

0 个答案:

没有答案