Android的应用内计费V3:不接收签名不接收、Android

2023-09-06 02:05:16 作者:┈處野蠻底綫┈

我工作的一个在App Store中对我的应用程序,我用AndroidBillingLibrary由robotmedia, 当我购买的的 android.test.purchased 的使用该库的响应是确定的,我需要的数据都在那里。

I'm working on a In App Store on my app, I used AndroidBillingLibrary by robotmedia, when I purchase android.test.purchased using the library the response is OK, all the data I need is in there.

现在的问题是,当我切换到的的 Android的应用内结算V3 的这是所有从收到的响应,没有签名。

The problem is, when I switched to Android In-App Billing v3 this is all received from the response, no signatures.

{"packageName":"com.my.sampleapp","orderId":"transactionId.android.test.purchased","productId":"android.test.purchased","developerPayload":"","purchaseTime":0,"purchaseState":0,"purchaseToken":"inapp:com.my.sampleapp:android.test.purchased"}

{"packageName":"com.my.sampleapp","orderId":"transactionId.android.test.purchased","productId":"android.test.purchased","developerPayload":"","purchaseTime":0,"purchaseState":0,"purchaseToken":"inapp:com.my.sampleapp:android.test.purchased"}

我完全按照这个样本的https://developer.android.com/training/in-app-billing/$p$pparing-iab-app.html#GetSample但没有签名。我甚至跑由谷歌,但没有运气给定的样本应用程序。

I followed exactly this sample https://developer.android.com/training/in-app-billing/preparing-iab-app.html#GetSample but there's no signatures. I even run the given sample app by Google but no luck.

我把我的Base64-CN codeD RSA公共密钥正确 mHelper =新IabHelper(这一点,myPublicKey);

I put my Base64-encoded RSA public key correctly in mHelper = new IabHelper(this, myPublicKey);

这是我购买code mHelper.launchPurchaseFlow(这一点,itempackage,10001,mPurchaseFinishedListener);

and this is my purchase code mHelper.launchPurchaseFlow(this, itempackage, 10001, mPurchaseFinishedListener);

OnIabPurchaseFinishedListener mPurchaseFinishedListener = new OnIabPurchaseFinishedListener() {
        public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
            Log.i("Billing", "purchasing: " + result.getMessage());

            if (result.isFailure()) {
                Log.i("Billing", "Error purchasing: " + result);
                return;
            } else if (purchase.getSku().equals("android.test.purchased")) {
                Log.i("Billing - signature", purchase.getSignature());
                consumeItems();
            } else {
                Log.i("Billing", "Error purchasing: " + result);
            }
        }
    };

不知怎的,我的的 mPurchaseFinishedListener 的购买,但保护无效onActivityResult(INT申请code,INT结果$ C后,不接受任何$ C,意图数据)正在接受的东西,但没有签名。

Somehow my mPurchaseFinishedListener is not receiving anything after the purchase but the protected void onActivityResult(int requestCode, int resultCode, Intent data) is receiving something but there's no signature.

要对此有何解决方案? 这是奇怪的是V2接收签名和v3是不是。

Any solutions to this? It's weird that v2 is receiving signatures and v3 is not.

推荐答案

您没有得到签名的测试标识,android.test.purchased等。

You don't get signatures for the test IDs, android.test.purchased, etc.

您将收到的签名与真正的购买。

You'll receive signatures with real purchases.