<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKTestSession/forceRenewalOfSubscription(productIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTestSession(im)forceRenewalOfSubscriptionWithProductIdentifier:error:"
  },
  "title" : "forceRenewalOfSubscription(productIdentifier:)"
}
-->

# forceRenewalOfSubscription(productIdentifier:)

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

```
func forceRenewalOfSubscription(productIdentifier: String) throws
```

## Parameters

`productIdentifier`

The [`productIdentifier`](/documentation/StoreKitTest/SKTestTransaction/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 <doc://com.apple.documentation/documentation/StoreKit/Transaction/expirationDate> property on the <doc://com.apple.documentation/documentation/StoreKit/Transaction> to the current system time. (If your app uses receipts, the receipt also shows this expiration date change). The testing environment also:

- Enables the subscription auto-renew state
- Removes a pending price increase, setting it to <doc://com.apple.documentation/documentation/StoreKit/Product/SubscriptionInfo/RenewalInfo/PriceIncreaseStatus-swift.enum/noIncreasePending>

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`](/documentation/StoreKitTest/SKTestSession/timeRate-swift.property) for more information.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)