<!--
{
  "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/enableAutoRenewForTransaction(identifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTestSession(im)enableAutoRenewForTransactionWithIdentifier:error:"
  },
  "title" : "enableAutoRenewForTransaction(identifier:)"
}
-->

# enableAutoRenewForTransaction(identifier:)

Enables auto-renewing for an auto-renewable subscription in the test environment.

```
func enableAutoRenewForTransaction(identifier: Int) throws
```

## Parameters

`identifier`

The transaction [`identifier`](/documentation/StoreKitTest/SKTestTransaction/identifier) of the auto-renewable subscription.

## Discussion

Call this method to enable the subscription to automatically renew in the testing environment. By default, all auto-renewable subscriptions have auto-renew enabled.

---

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)