如何升级安卓InAppBilling /降级订阅?InAppBilling

2023-09-05 06:35:57 作者:不服来打姐

我花了一周时间寻找解决方案,升级/降级订阅Android上的 InAppBilling 。

I spent a week looking for solution to upgrade/downgrade subscriptions on Android InAppBilling.

有关于这个功能的参考页面:http://developer.android.com/google/play/billing/billing_reference.html

There's a reference page about this function: http://developer.android.com/google/play/billing/billing_reference.html

谷歌表示,我们可以用 getBuyIntentToReplaceSkus()的方法,但我不能发现有关在其签名的任何文件。我也无法看到它在 IInAppBillingService.aidl 文件,谷歌提供的。

Google said that we could use getBuyIntentToReplaceSkus() method, but I couldn't found any documentation about that in its signature. I can't also see it in IInAppBillingService.aidl file that Google provided.

有没有一个谁可以帮我吗?

Is there any one who may help me?

推荐答案

首先感谢AIDL文件。

at first thanks for aidl file.

但对我来说,这是行不通的。我总是得到一个错误code 5:

But for me it is not working. I always get an error code 5:

提供的API参数无效。这个错误也可能表示   该应用程序未正确签名或正确地设置为   在应用内计费在谷歌播放,或者没有必要   在其清单的权限

Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest

我不认为权限是错误的或者未正确签署的所有 其他的付款请求工作。

I don't think that the permissions are wrong or it is not correctly signed as all other payment requests work.

这是我的code:

List<String> subs = new ArrayList<>();
subs.add(current_sub);
buyIntentBundle = mService.getBuyIntentToReplaceSkus(3, "package", subs,
       key, "subs", getResources().getString(R.string.developer_payload));

您如何执行升级的要求还是你看到任何错误在我的要求吗?

How do you execute an upgrade request or do you see any error in my request?

谢谢 固相线

相关推荐