Apple IAP Subscription cancellation

I am implementing support for subscriptions and receipt validation
One of the fields of the AppleInAppPurchaseReceipt the Cancellation date and I would like to know what the default value would be if the IAP has been purchased but not canceled, So I know when to compare the cancellation date to the current date and when to ignore it.

Also, I’m working Unity 5.6.5

    public class AppleInAppPurchaseReceipt : IPurchaseReceipt
    {
        public AppleInAppPurchaseReceipt();

        public int quantity { get; }
        public string productID { get; }
        public string transactionID { get; }
        public string originalTransactionIdentifier { get; }
        public DateTime purchaseDate { get; }
        public DateTime originalPurchaseDate { get; }
        public DateTime subscriptionExpirationDate { get; }
        public DateTime cancellationDate { get; } // <- what is the value of this if the purchase has not been canceled
    }

We will be improving Subscription support in the next release, due out in the next weeks.

I get the impression that the code that I referenced is a placeholder then?

What are you seeing for the default cancellationDate in your testing? I would expect it to be null if no cancellation has occurred. However, you would want to wait a week or two where we will be doing this work for you in the next release.

I’ve noticed that the expiration date and the cancelation date are initialized to 0001 year and etc for the other datetime fields. So for now I am assuming that when the dates are before the purchase date, they were omitted from the json data provided the apple stores. However, I’ve yet to confirm this behaviour with subscriptions. I’ll get back to this thread when I do.

Hi, do you have any update on the next release? At least what should we expect and if it’s worth waiting for new functionality? Haven’t seen anything related in the roadmap :frowning:

IAP Version 1.19 is now available on the Asset Store Unity IAP (this version obsolete, use Package Manager) | Services | Unity Asset Store

@JeffDUnity3D how would I use this though? Do I need to create a new SubscriptionManager for each product, after Unity IAP initialized (OnInitialized callback)? Also, what should we pass into the “intro_json” parameter?

@Baroni1 The documentation for the subscription support will be forthcoming, I’ll check into your questions also.

1 Like

@Baroni1 ,

The docs will be added to the Manual during the next publishing cycle, but for now, we have posted a version of them here:

1 Like

Also, you can check out IAPDemo.cs that is shipped with Unity IAP for usage of the SubscriptionManager class.