Subscription status not updating in iOS sandbox

Hi there,

I have two problems about subscription purchase in IAP 1.23.0.
In a sandbox test of iOS, there are following 2 issues:

(1) Subscription status is not updated automatically

I purchased a subscription product.
I called “CheckSubscription()” and got the first subscription status such as “isExpired()” or ”getExpireDate()”.
After 5 minutes (1 month) from the first purchase, these statuses did not change.

Then, I purchased the subscription product again.
Dialog of iPhone mentioned “You’ve Already Purchased This Subscription”.
I got the second subscription status after that.

After 5 more minutes, this status will not be updated to the 3rd subscription status.
It is same if I wait for 30 minutes or 1 hour.

(2) Receipt is missing after closing the app
Once I shutdown the app and start again, “m_StoreController.products.WithID(productID).receipt” become null.
I was not able to check the subscription status.

Then, I purchased the subscription product again.
Dialog mentioned “You’ve Already Purchased This Subscription”.
I got the latest subscription status.
It will not be updated as I wrote in (1).

I use the following code to check the subscription status.
How can I solve these problems?
Do I need to do anything else to get latest status and keep receipt info?

public bool CheckSubscription(string productID) {

        var item = m_StoreController.products.WithID(productID);

        Dictionary<string, string> introductory_info_dict = m_AppleExtensions.GetIntroductoryPriceDictionary();
       
        if (item.availableToPurchase)
        {
            if (item.receipt != null) {
                if (item.definition.type == ProductType.Subscription) {

                        string intro_json = (introductory_info_dict == null || !introductory_info_dict.ContainsKey(item.definition.storeSpecificId)) ? null : introductory_info_dict[item.definition.storeSpecificId];
                        SubscriptionManager p = new SubscriptionManager(item, intro_json);
                        SubscriptionInfo info = p.getSubscriptionInfo();

                        Debug.Log("info.isExpired=" + info.isExpired());
                        Debug.Log("info.getExpireDate=" + info.getExpireDate());

                    return true;

                } else {
                    Debug.Log("This product is not a subscription product");
                }
            } else {
                Debug.Log("This product should have a valid receipt");
            }
        } else {
            Debug.Log("Not available for purchase");
        }
        return false;
    }

I will test this behavior, thank you for providing the detailed steps. I will try the same.

Hi Jeff,

Thanks for your support.
I am waiting for your reply.

I’m seeing the same behavior in my testing. I’m hoping that that it’s just behavior in their Sandbox environment. I would expect a ProcessPurchase to fire upon IAP initialization for each subscription renew after 5 minutes. Plus, I was able to purchase the same subscription twice in a row, which should not be possible. It looks like it expires after 5 minutes, but should auto-renew. Restore looks like it works as expected, but users with auto-renewing subscriptions should not have to Restore to get their products. It should behave as expected in Production. This article comes to similar conclusions https://savvyapps.com/blog/how-setup-test-auto-renewable-subscription-ios-app

Hi Jeff,

Thanks for testing it and providing information.
It is really helpful.
I hope issue #1 will not happen in production.

How about issue #2?
Is it also related to the sandbox environment?

I would suspect so.