---
title: NSExtensionContext.DidBecomeActiveMessage
framework: foundation
role: symbol
role_heading: Structure
path: foundation/nsextensioncontext/didbecomeactivemessage
---

# NSExtensionContext.DidBecomeActiveMessage

A message the system sends when the extension’s host app moves from the inactive to the active state.

## Declaration

```swift
struct DidBecomeActiveMessage
```

## Overview

Overview You can use this message to adjust your extension’s activity when the host app becomes active. Observe this message with the identifier didBecomeActive, or specify its type directly to the addObserver(of:for:using:) method. The Subject of this message type is NSExtensionContext. This message interoperates with the notification NSExtensionHostDidBecomeActive. The system notifies observers of the message when the NotificationCenter posts the notification. Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message for a host app becoming active

- [init()](foundation/nsextensioncontext/didbecomeactivemessage/init().md)

## Relationships

### Conforms To

- [NotificationCenter.MainActorMessage](foundation/notificationcenter/mainactormessage.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with notification messages

- [NSExtensionContext.WillResignActiveMessage](foundation/nsextensioncontext/willresignactivemessage.md)
- [NSExtensionContext.DidEnterBackgroundMessage](foundation/nsextensioncontext/didenterbackgroundmessage.md)
- [NSExtensionContext.WillEnterForegroundMessage](foundation/nsextensioncontext/willenterforegroundmessage.md)
