应用内结算测试RESULT_DEVELOPER_ERROR

发布于 12-09 19:30 字数 799 浏览 1 评论 0原文

我正在使用开发者帐户和测试项目 (android.test.purchased) 在手机上测试应用程序。当我调用 isBillingSupported() 方法时,我的 ResponseCodeRESULT_DEVELOPER_ERROR。我没有在市场上发布该应用程序,但我读到这是不必要的,因为我使用 android.test.purchased

<uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.READ_OWNER_DATA"/>
    <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/>        
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>  
    <uses-permission android:name="com.android.vending.BILLING"/>

我把它作为草稿上传到市场上,但仍然没有运气......我失去了勇气......

I'm testing an app on my phone with a developer account and with test items (android.test.purchased). When I call the isBillingSupported() method, my ResponseCode is RESULT_DEVELOPER_ERROR. I didn't publish the app on the market, but I read that it is unnecessary because I use android.test.purchased.

<uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.READ_OWNER_DATA"/>
    <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/>        
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>  
    <uses-permission android:name="com.android.vending.BILLING"/>

I uploaded it on the market as a draft, and still no luck... I'm losing my nerve...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遮了一弯2024-12-16 19:30:01

要回答您对 @Samir 的回答的评论中的问题:

“我的问题是我是否需要签署应用程序才能发布”

是的,你需要。

“我需要在市场上发布吗???”

不,你不知道。

To answer the questions in your comments to @Samir's answer:

"my question is do i need to sign an app for release"

Yes, you do.

"do i need to publish on market???"

No, you don't.

挽清梦2024-12-16 19:30:01

确保您的包名称正确。

尽管您最终需要对应用程序进行签名才能发布(如何执行此操作),您应该能够调用 isBillingSupported() 而无需签署应用程序,并让它返回 RESULT_OK,只要您拥有 BILLING 权限并且您的包名称与您的应用程序的包名称完全相同。我使用了不同的硬编码包名称,并且 isBillingSupported() 返回 RESULT_DEVELOPER_ERROR

这是我调用 isBillingSupported() 的工作代码:

String packageName = context.getPackageName();

try
{
    IInAppBillingService service = activity.getBillingService();
    int response = service.isBillingSupported(3, packageName, "inapp");
    Log.i("mylogtag", "response: " + response);
}
catch (RemoteException re)
{
    re.printStackTrace();
}

Make sure your package name is correct.

Although you will eventually need to have the app signed for release (how to do this), you should be able to call isBillingSupported()WITHOUT signing the app, and have it return RESULT_OKas long as you have the BILLING permission on AND your package name is the same exact one for your app. I was using a different, hard coded package name, and isBillingSupported()was returning RESULT_DEVELOPER_ERROR.

So here is my working code that calls isBillingSupported():

String packageName = context.getPackageName();

try
{
    IInAppBillingService service = activity.getBillingService();
    int response = service.isBillingSupported(3, packageName, "inapp");
    Log.i("mylogtag", "response: " + response);
}
catch (RemoteException re)
{
    re.printStackTrace();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文