Contents

forceRenewalOfSubscription(productIdentifier:)

Ends the previous subscription period and begins the next period in the test environment.

Declaration

func forceRenewalOfSubscription(productIdentifier: String) throws

Parameters

  • productIdentifier:

    The Productidentifier of the auto-renewable subscription to renew.

Discussion

Use this method to test how your code handles subscription renewals. When you call this method, the subscription expires at the time you call the method, and a new subscription period begins.

To force the subscription renewal, the testing environment changes the expirationDate property on the Transaction to the current system time. (If your app uses receipts, the receipt also shows this expiration date change). The testing environment also:

The testing environment doesn’t change the billing retry state with this call.

You can also test subscription renewals by accelerating the time in the testing environment to speed up subscription renewal periods. See timeRate for more information.

See Also

Testing subscription renewals