iOS subscription cancelled state

Hi,

I am developing an iOS app and implementing a subscription feature. I have a question about renewing my subscription.
According to Unity’s documentation (Unity - Manual: Subscription Product support), it should be possible to check whether the subscription has been cancelled or not by checking the value of “isCancelled”, but in reality, only “Result.False” is returned. The environment I am working in is Sandbox.
thank you.

Hello,

I believe the description is misleading, the isCancelled is based on the cancellationDate in the AppleInAppPurchaseReceipt which only applies when cancelled by Apple directly or when upgrading a subscription.
I’ve taken note of this and the description will be updated.

There’s also the isExpired and isAutoRenewing that might do what you’re looking for.

If you need further help for this, could you give us more detail on your case and what you’re trying to verify?

thank you.

I have verified using the following code:

public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
{
    storeController = controller;
    extensionProvider = extensions;
   
    IAppleExtensions appleExtensions = extensionProvider.GetExtension<IAppleExtensions>();
    Dictionary<string, string> introductoryPriceDictionary = appleExtensions.GetIntroductoryPriceDictionary();

    foreach (Product product in controller.products.all)
    {
        if (item.receipt != null && item.definition.type == ProductType.Subscription) {
            string introJson = introductoryPriceDictionary[product.definition.storeSpecificId];

            // receipt check
            if (CheckReceiptOfApple(product.receipt))
            {
                SubscriptionManager p = new SubscriptionManager(product, introJson);
                SubscriptionInfo info = p.getSubscriptionInfo();

                CheckSubscriptionInfo(info);
               
                Debug.Log("isExpired " + info.isExpired());
                Debug.Log("isAutoRenewing " + info.isAutoRenewing());
            }
        }
    }
}

As a result, even after the user cancels, isExpired remains False, and isAutoRenewing remains True. This is the same result as before the cancellation.

What I’m trying to achieve is to determine whether the subscription will be renewed in the next billing cycle or if it will be canceled.
For example, I’m looking for the following behavior:
1.Purchase subscription product A.
2.isAutoRenewing is True.
3.Cancel subscription product A.
4.isAutoRenewing becomes False.
However, in reality, isAutoRenewing always remains True.

Hi, we’re facing the exact same issue. We want to display a special Paywall with discount if we know the user won’t renew at the end of the active period. The users will still have access to the premium features, but we want to try to make them resubscribe to an other plan.

I confirm that isAutoRenewing, isCancelled, isSubscribed, isExpired doesn’t update after user cancel the renew.
We’ve tested it in production, and none of those variable changes.

If you figure it out, please let me know. We’ll dig on our side as well.

Hi there / all,

updating these values would require fetching them from the App Store periodically. Unity IAP does not do this, therefore it is mostly unaware of any live changes on subscriptions. To receive live updates, you would need to have a server connect to App Store Server Notifications, which processes these notifications in the moment they happen, so users can retrieve their updated inventory (from your server).

#AD
I am offering a Receipt Validation Service that makes your IAPs most secure and additionally, implements App Store Server Notifications for real-time purchase and subscription updates. The service manages user’s inventory, so it can be requested at any time, for displaying resubscribe offers or just telling them when exactly their subscription expires. It can be implemented using a separate Unity SDK or in combination with my “Simple IAP System” asset on the Asset Store.

Thanks, we will try your service shortly!

1 Like