gpt4 book ai didi

android - 应用内结算 RESTORE_TRANSACTION 给出 DEVELOPER_ERROR

转载 作者:行者123 更新时间:2023-11-29 15:27:10 24 4
gpt4 key购买 nike

我正在我的应用中实现应用内结算。我刚刚实现了 REQUEST_PURCHASE、CONFIRM_NOTIFICATION 和 CHECK_BILLING,它们运行良好。

现在我正在尝试实现 REQUEST_TRANSACTIONS 方法,但我遇到了一个问题,一旦我使用 sendBIllingRequest 发送了请求,我就会收到一个带有 RESULT_DEVELOPER_ERROR (5) 的 RESPONSE_CODE 响应。

这是我提出请求的方式:

    Log.d(TAG, "Action equals RESTORE_TRANSACTIONS");
Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
request.putLong("NONCE", BillingSecurity.newNonce());
try {
Bundle response = mService.sendBillingRequest(request);
int response_code = response.getInt("RESPONSE_CODE", -1);
Log.d(TAG, "RESPONSE Restore: " + response_code);
restored=true;
} catch (RemoteException e) {
e.printStackTrace();
}

我阅读了其他问题,在禁用 Debug模式时需要启动 RESTORE_TRANSACTIONS。我从 list 中禁用了它(我清除了该字段,因为如果我输入错误的 LogCat 不会显示任何调试打印),所以这是我的 Android list :

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="resistorcalc.main"
android:versionName="3.0" android:versionCode="9">
<uses-sdk android:minSdkVersion="8"></uses-sdk>

<uses-permission android:name="com.android.vending.BILLING" />

<application android:label="@string/app_name" android:name=".App" android:icon="@drawable/resistoricon">
<activity android:name=".launchActivity"
android:label="@string/app_name" android:screenOrientation="portrait" android:clearTaskOnLaunch="true" android:finishOnTaskLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:launchMode="standard" android:label="@string/app_name" android:name="SupportusActivity" android:finishOnTaskLaunch="true" android:clearTaskOnLaunch="true" android:screenOrientation="portrait"></activity>
<activity android:launchMode="standard" android:label="@string/app_name" android:name="OhmLawActivity" android:finishOnTaskLaunch="true" android:clearTaskOnLaunch="true" android:screenOrientation="portrait"></activity>
<activity android:launchMode="standard" android:label="@string/app_name" android:name="ResistorSumActivity" android:finishOnTaskLaunch="true" android:clearTaskOnLaunch="true" android:screenOrientation="portrait"></activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" android:clearTaskOnLaunch="true" android:finishOnTaskLaunch="true"/>
<service android:name=".billing.BillingService" />

<receiver android:name=".billing.BillingReceiver">
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
</application>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

现在我的问题是:

  1. 我需要在 list 上的 Debuggable 标志上设置 false 吗?或者我只需要运行应用程序。
  2. 如果 debuggable 设置为 false,为什么 logcat 不显示任何 Log.* 消息?这是一个正常的行为(我在 eclipse 中使用 logcat)
  3. 如果我使用像 android.test.purchased 这样的静态请求,它们可以使用 RESTOrE_TRANSACTIONS 检索吗?
  4. 我是否需要将草稿上传到我的市场才能使该方法起作用?

谢谢,伊万

最佳答案

list 中的调试标志与此无关。您需要使用发布 key 签署您的应用程序并将草稿上传到 Play 商店。您可能需要等待一个小时左右才能激活它。不,RESTORE_TRANSACTIONS 不适用于测试项目,您需要使用自己发布的项目。所有这些都是described in the reference ,如果你遵循它,你应该不会有任何问题。

关于android - 应用内结算 RESTORE_TRANSACTION 给出 DEVELOPER_ERROR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10896720/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com