Android IAP getBuyIntentToReplaceSkus does not cancel old subscription

I am trying to upgrade / downgrade an Android app. I believe that I did everything correctly, but it does not seem to work correctly during testing.

My application has three options: monthly, 3-month and 6-month subscription options. When I subscribe to any option, I call the following function, where "sku" is sku for the purchased item and "oldSkus" is skus for other items.

buyIntentBundle = mService.getBuyIntentToReplaceSkus(5, mContext.getPackageName(), oldSkus, sku, itemType, extraData); 

When I subscribe to the 3-month version, it works fine, and the application correctly receives a 3-month subscription in the Play Store. If I try to switch to a subscription for 6 months, the following flow will occur:

  • The "Change Subscription" dialog box appears, indicating "Current Plan" and "New Plan" β†’ Click Continue
  • Details of the plan are indicated. Click β†’ β€œSubscribe” β†’ β€œVerify”
  • The transaction was successful, and the purchase data is returned to the application.
  • Receive email subscription has been updated:
    • Previous plan: 3 months: Canceled
    • New plan: 6 months: Active immediately
  • Go to your Play Store account and view subscriptions.
    • 3-month plan - Subscription with Cancel button
    • 6-month plan - subscription with Cancel button
  • GetInventory application and observer launch results
    • 3-month plan - User subscribed to
    • 6-month plan - User subscribed to

As far as I can tell, the old subscription was not correctly canceled on the Play Store. I hope this only happens because I use the tester counter and $ / day, which occurs when testing a subscription causes some pro-evaluation problems.

UPDATE: Google answered my ticket and informed me that they exacerbated the problem. I am updated again when I get another answer.

+5
source share
1 answer

I tested it with real money. The old subscription was canceled (I think it was canceled, as Google Play understands it). After the update, the old subscription is no longer displayed in the details of the application in the Google Play application - only the new one.

Although I'm not sure how to recognize it using the Google Play Developer APIs - how to recognize that this old subscription is no longer valid. The get method on the Buyases.subscriptions resource returns autoRenew as false (which is good), but it’s not enough to recognize that the functions for this subscription are no longer available to the user, since this happens when the user cancels the subscription and when the user cancels the subscription the functions must be available before the expiration validity period.

Unfortunately, the expiration date returned by the get call still has the same value, so I cannot use this.

UPDATE: the getPurchases method on the Android client does not return the old subscription after the upgrade. I wonder if there is a way to recognize it through the Google Play Developer APIs.

0
source

Source: https://habr.com/ru/post/1234325/


All Articles