Search code examples
iosipadin-app-purchasepayment

Using SKPayment API to deal with subscription upgrades


I have subscriptions working in the app I am dealing with, but I want to add a second subscription and allow upgrading from the old one (A) to the new one (B). (Note: I have both subscriptions configured in the same category on the developer portal.)

When someone purchases B (after already having purchased A), I am calling the same API:

    let payment = SKPayment(product: product)
    SKPaymentQueue.default().add(payment)

When I try this in the sandbox I see there are two subscriptions and A will eventually go away, but the message the user sees doesn't say anything specific about upgrade. I tested with another app on the App Store, and when I upgrade I see a message beginning with "Your upgrade will start now."

So it seems there is some different API call required, or some other flag, in order to trigger the upgrade instead of a separate purchase.

What do I need to do to properly support subscription upgrades?

Update: here is a screenshot from another app that shows the text I am talking about.enter image description here

Update 2: It is possible that the message in question only shows up when the app is actually in the App Store, but I don't want to actually release this until I know it is working. So if someone can also let me know if "Your upgrade will start now." message is supposed to show up for sandbox as well, that would be helpful.


Solution

  • When the app went live the correct message was shown when doing actual purchases. So no special API calls are required, it was just that there are bugs or quirks with the Sandbox mode.