<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UserNotifications",
  "identifier" : "/documentation/UserNotifications/UNNotificationServiceExtension/serviceExtensionTimeWillExpire()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "User Notifications"
    ],
    "preciseIdentifier" : "c:objc(cs)UNNotificationServiceExtension(im)serviceExtensionTimeWillExpire"
  },
  "title" : "serviceExtensionTimeWillExpire()"
}
-->

# serviceExtensionTimeWillExpire()

Tells you that the system is terminating your extension.

```
func serviceExtensionTimeWillExpire()
```

## Discussion

If your [`didReceive(_:withContentHandler:)`](/documentation/UserNotifications/UNNotificationServiceExtension/didReceive(_:withContentHandler:)) method takes too long to execute its completion block, the system calls this method on a separate thread to give you one last chance to execute the block. Use this method to execute the block as quickly as possible. Doing so might mean providing some fallback content. For example, if your extension is still downloading an image file with the intent of attaching it to the notification’s content, update the notification’s alert text to indicate that an image download is in progress. If you fail to execute the completion block from the [`didReceive(_:withContentHandler:)`](/documentation/UserNotifications/UNNotificationServiceExtension/didReceive(_:withContentHandler:)) method in time, the system displays the notification’s original content.

---

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)