How to upgrade/downgrade subscriptions in Android InAppBilling?

前端 未结 5 1674
南旧
南旧 2020-12-30 07:05

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

There\'s a reference page about this function: http

相关标签:
5条回答
  • 2020-12-30 07:22

    at first thanks for aidl file.

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

    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.

    This is my 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?

    Thanks Solidus

    0 讨论(0)
  • 2020-12-30 07:33

    This seems to be a mistake/bug from google. They have not updated aidl file correctly. You can probably add this method to aidl file yourself (and figure out correct signature by try&error) but if you can you should wait a little while they get their act together.

    0 讨论(0)
  • 2020-12-30 07:34

    I had the similar issue and found out that

    1. it is only supported in version 5
    2. the position of new sku (the array list) and old sku should be changed. Even though the methods shows first old and then new.. make the other way.
    0 讨论(0)
  • 2020-12-30 07:38

    Just use my aidl file and be happy :)

    It works perfectly!

    https://gist.github.com/cre8ivejp/21b10fbbc7e500f99059

    *Do not change the order of the methods inside aidl file or it will not work.

    0 讨论(0)
  • 2020-12-30 07:42

    You just have to update the 'aidl' file from the official gitHub, and clean-build the project:

    https://github.com/googlesamples/android-play-billing/blob/master/TrivialDrive/app/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl

    You'll be happy forever after.

    0 讨论(0)
提交回复
热议问题