My app has a subscription group with 2 levels of subscription: monthly and yearly. If the user purchases the "yearly" level, then downgrades to "monthly", the iOS dialog that pops up says that the new downgraded level will start after the current higher level finishes. That's fine; that behavior is what Apple describes in the WWDC videos.
But how do I reflect this new situation in my View? I now have an active annual subscription and there's a monthly view that is "scheduled" to start once the annual subscription is up for renewal. I know how to show that the annual subscription is still active but I want to show the user that there's a monthly subscription that will start later. How do I query for this case to reflect it in my view? There are no new transactions since the monthly subscription hasn't yet been purchased. I don't want the user to keep pressing a "buy" button for "monthly" to downgrade and not get any feedback other than the iOS dialog.
I am not using a server of my own to manage subscriptions.
The mechanism I developed to handle subscriptions turns out to deal with upgrades and downgrades just fine. I use two detached Tasks that each have a listener function.
The first detached task listens for transactions. Its key line is:
for await result in Transaction.updates {
It updates my local list of subscription statuses as needed.
The second detached task listens for subscription changes like:
for await _ in Product.SubscriptionInfo.Status.updates {
and also updates the local list of subscription statuses.