<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FinanceKit",
  "identifier" : "/documentation/FinanceKit/BackgroundDeliveryExtensionProviding/willTerminate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FinanceKit"
    ],
    "preciseIdentifier" : "s:10FinanceKit36BackgroundDeliveryExtensionProvidingP13willTerminateyyYaF"
  },
  "title" : "willTerminate()"
}
-->

# willTerminate()

Get alerted when a `BackgroundDeliveryExtension` is about to close.

```
func willTerminate() async
```

## Discussion

This is called when the extension approaches the end of its time window and is about to be terminated by the system. It provides an opportunity to safely end any ongoing operations and save changes to data. When the time window is exceeded, the extension terminates even if execution is within `willTerminate`.

> Important:
> For certain system events, `willTerminate` may not be called before the extension is terminated.

---

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)