<!--
{
  "availability" : [
    "iOS: 10.0.0 - 12.0.0",
    "iPadOS: 10.0.0 - 12.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.12.0 - 10.14.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEProvider/displayMessage(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEProvider(im)displayMessage:completionHandler:"
  },
  "title" : "displayMessage(_:completionHandler:)"
}
-->

# displayMessage(_:completionHandler:)

Call this method from your [`NEProvider`](/documentation/NetworkExtension/NEProvider) subclass if you want to display a message to the person using the app.

```
func displayMessage(_ message: String, completionHandler: @escaping @Sendable (Bool) -> Void)
```

## Parameters

`message`

The message you want to display to the person using the app.

`completionHandler`

A block that the system calls after you call this method. The details of the call can vary, as follows:

- If the system can’t display the message, or if you call the `displayMessage:completionHandler:` method in an [`NEFilterDataProvider`](/documentation/NetworkExtension/NEFilterDataProvider) instance, then the system calls the `completionHandler` block immediately after you call the method, and sets the block’s `success` parameter value to <doc://com.apple.documentation/documentation/Swift/false>.
- If the system successfully displays the message to the user, then the system calls the `completionHandler` block when the user dismisses the message, and sets the `success` parameter value to <doc://com.apple.documentation/documentation/Swift/true>.

---

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)