<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Message",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit7MessageV"
  },
  "title" : "Message"
}
-->

# Message

An instance for receiving and displaying App Store messages in your app.

```
struct Message
```

## Overview

A StoreKit message represents a sheet that appears over your app to display important information from the App Store. Messages have a reason, which the  [`reason`](/documentation/StoreKit/Message/reason-swift.property) value indicates. StoreKit retrieves any messages from the App Store each time your app launches, and presents them by default.

> Note:
> StoreKit displays messages from the App Store regardless of the SDK version you use to build your app. Apps built for iOS 16 and later can implement a message listener and delay or suppress messages.

You can optionally use the `Message` API to control message presentation by delaying or suppressing messages. Your app can listen for messages with the [`messages`](/documentation/StoreKit/Message/messages-swift.type.property) asynchronous sequence, and can display them at a particular time by calling [`display(in:)`](/documentation/StoreKit/Message/display(in:)), or [`DisplayMessageAction`](/documentation/StoreKit/DisplayMessageAction) for SwiftUI views. For example, you may choose to delay messages in views where an interrupting sheet might confuse someone, such as in the middle of an onboarding flow, or if your app is providing real-time instructions.

StoreKit presents message sheets only if a message is still relevant. For example, if a person resolves the issue outside your app before it calls [`display(in:)`](/documentation/StoreKit/Message/display(in:)), StoreKit doesn’t present the message. StoreKit ensures that it presents each unique message once, even if the app asks to display messages multiple times.

### Listen for and display messages

If you want to defer or suppress App Store messages, set up the message listener in your app when your app launches.

To control when a message may display, call [`display(in:)`](/documentation/StoreKit/Message/display(in:)) or [`DisplayMessageAction`](/documentation/StoreKit/DisplayMessageAction) when your app’s ready to have StoreKit present the message. If your app doesn’t call either of these APIs after it listens for messages, it suppresses the messages. The following example is for apps that use <doc://com.apple.documentation/documentation/UIKit>:

```swift
// Listen for App Store messages.
for await message in StoreKit.Message.messages {
    // Call display on the message when the app is ready.
}

// Indicate the app is ready to display the message.
guard let windowScene = self.view.window?.windowScene else {
    fatalError("Could not get window scene.")
}
try? message.display(in: windowScene)
```

For a code example that uses SwiftUI, see [`DisplayMessageAction`](/documentation/StoreKit/DisplayMessageAction).

## Topics

### Getting messages and message reasons

[`messages`](/documentation/StoreKit/Message/messages-swift.type.property)

The asynchronous sequence that sends a message when the App Store creates it.

[`reason`](/documentation/StoreKit/Message/reason-swift.property)

The reason that the App Store sends the message.

[`Message.Messages`](/documentation/StoreKit/Message/Messages-swift.struct)

An asynchronous sequence of messages from the App Store.

[`Message.Reason`](/documentation/StoreKit/Message/Reason-swift.struct)

Reasons for the App Store messages.

### Displaying messages

[`display(in:)`](/documentation/StoreKit/Message/display(in:))

Requests the system to display the App Store message in the window scene.



---

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)