Contents

timeRate

The rate at which time passes for subscriptions in the test environment as compared to real time.

Declaration

var timeRate: SKTestSession.TimeRate { get set }

Discussion

Use the timeRate value when you test auto-renewable subscriptions to speed up or slow down the time it takes for subscriptions to renew in the test environment. The default value is SKTestSession.TimeRate.realTime. For maximum accelerated time, use SKTestSession.TimeRate.oneRenewalEveryTwoSeconds.

To test subscription renewals, you can also call forceRenewalOfSubscription(productIdentifier:) to prompt a subscription to renew immediately.

The time rate also affects the length of the billing retry period and the billing grace period in the test environment. See the SKTestSession.TimeRate enumeration for the actual time values of each case.

Changing this property overrides its setting in the StoreKit configuration file for this test session. Call resetToDefaultState() to revert all settings to those in the configuration file.

See Also

Testing subscription renewals