Instance Property

presentationContext

The context describing where your iMessage app is presented.

Declaration

var presentationContext: MSMessagesAppPresentationContext { get }

Discussion

By default, the system only displays iMessage apps in the MSMessagesAppPresentationContext.messages context (the iMessage app only appears inside the Messages app). iMessage apps in the media context have additional limitations and design considerations.

You can control the supported contexts by adding the MSSupportedPresentationContexts key to the iMessage app extension’s info.plist file. For example, Listing 1 enables the iMessage app in effects in Messages and FaceTime.

<key>MSSupportedPresentationContexts</key>
<array>
  <string>MSMessagesAppPresentationContextMessages</string>
  <string>MSMessagesAppPresentationContextMedia</string>
</array>

See Also

Working with Presentation Styles and Contexts

var presentationStyle: MSMessagesAppPresentationStyle

The extension’s current presentation style.

func requestPresentationStyle(MSMessagesAppPresentationStyle)

Asks the extension’s user interface to transition to the provided style.

func willTransition(to: MSMessagesAppPresentationStyle)

Tells the view controller that the extension is about to transition to a new presentation style.

func didTransition(to: MSMessagesAppPresentationStyle)

Tells the view controller that the extension has transitioned to a new presentation style.

enum MSMessagesAppPresentationStyle

Presentation styles that describe your iMessage app’s appearance.

enum MSMessagesAppPresentationContext

Presentation contexts describing where your iMessage app appears.