> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-ios-ui-kit-sdk-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch Chat Window On Tap Of Push Notification

> Guide to launching the chat window from UI Kit when user taps a message push notification.

<Info>
  **Quick Reference for AI Agents & Developers**

  * **Requires:** CometChat SDK and UI Kit both configured
  * **Implementation:** Handle notification tap in `AppDelegate` or `SceneDelegate`
  * **Parse payload:** Extract sender UID or group GUID from notification payload
  * **Launch:** Present `CometChatMessages` view controller with user/group
  * **Related:** [Receive Message](/sdk/ios/receive-message) · [Push Notifications](/sdk/ios/push-notification-overview) · [UI Kit](/ui-kit/ios/overview)
</Info>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-ios-ui-kit-sdk-fixes/6jIKcfaSXBGFoEO7/images/6dadea7d-1623200476-03f865d337fcaade4b2092abf8721a03.jpg?fit=max&auto=format&n=6jIKcfaSXBGFoEO7&q=85&s=0eee2c70b8e6f9ebb3fb8bb5489d6abb" width="1229" height="888" data-path="images/6dadea7d-1623200476-03f865d337fcaade4b2092abf8721a03.jpg" />
</Frame>

This guide helps you to launch a chat window from the UI Kit library on receiving a new message notification.

<Tip>
  CometChat SDK & UI Kit both need to be configured before launching the chat window.
</Tip>

***

## Step 1. Process push notification payload and grab `User` or `Group` object

To present a chat window, firstly you will need a `User` or a `Group` object. You can grab this from the push notification payload itself of incoming message notification. You need to call `CometChat.processMessage()` method to process push notification payload.

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
     func userNotificationCenter(_ center: UNUserNotificationCenter,
                        didReceive response: UNNotificationResponse,
                        withCompletionHandler completionHandler: @escaping () -> Void) {
            
            if let userInfo = response.notification.request.content.userInfo as? [String : Any], let messageObject = userInfo["message"] as? [String:Any] {
               print("didReceive: \\(userInfo)")
              if let baseMessage = CometChat.processMessage(messageObject).0 {
                switch baseMessage.messageCategory {
                case .message:
                    print("Message Object Received: \\(String(describing: (baseMessage as? TextMessage)?.stringValue()))")
                    
                case .action: break
                case .call: break
                case .custom: break
                @unknown default: break
                }
              }
            }
            completionHandler()
          }
    ```
  </Tab>
</Tabs>

<Accordion title="Sample Payload - User Message Push Notification">
  **userInfo Dictionary Structure (User Message):**

  | Parameter | Type           | Description                                                                                             |
  | --------- | -------------- | ------------------------------------------------------------------------------------------------------- |
  | message   | \[String: Any] | Message dictionary containing message details. See [message Dictionary](#user-message-dictionary) below |
  | aps       | \[String: Any] | Apple Push Notification Service payload. See [aps Dictionary](#user-message-aps-dictionary) below       |

  <span id="user-message-dictionary" />

  **message Dictionary:**

  | Parameter      | Type           | Description                                                                         |
  | -------------- | -------------- | ----------------------------------------------------------------------------------- |
  | id             | Int            | Unique message identifier. Example: `12345`                                         |
  | muid           | String         | Message unique ID. Example: `"muid_xyz123"`                                         |
  | category       | String         | Message category. Example: `"message"`                                              |
  | type           | String         | Message type. Example: `"text"`                                                     |
  | text           | String         | Message content. Example: `"Hello there!"`                                          |
  | sender         | \[String: Any] | Sender user details. See [sender Dictionary](#user-message-sender-dictionary) below |
  | receiver       | String         | Receiver UID. Example: `"cometchat-uid-2"`                                          |
  | receiverType   | String         | Receiver type. Example: `"user"`                                                    |
  | sentAt         | Int            | Unix timestamp. Example: `1699800000`                                               |
  | deliveredAt    | Int            | Delivery timestamp. Example: `0`                                                    |
  | readAt         | Int            | Read timestamp. Example: `0`                                                        |
  | conversationId | String         | Conversation ID. Example: `"cometchat-uid-1_user_cometchat-uid-2"`                  |

  <span id="user-message-sender-dictionary" />

  **sender Dictionary:**

  | Parameter    | Type   | Description                                                      |
  | ------------ | ------ | ---------------------------------------------------------------- |
  | uid          | String | Sender's unique ID. Example: `"cometchat-uid-1"`                 |
  | name         | String | Sender's display name. Example: `"Andrew Joseph"`                |
  | avatar       | String | Sender's avatar URL. Example: `"https://example.com/avatar.png"` |
  | status       | String | User online status. Example: `"online"`                          |
  | role         | String | User role. Example: `"default"`                                  |
  | lastActiveAt | Int    | Last active timestamp. Example: `1699799000`                     |

  <span id="user-message-aps-dictionary" />

  **aps Dictionary:**

  | Parameter       | Type           | Description                                                                 |
  | --------------- | -------------- | --------------------------------------------------------------------------- |
  | alert           | \[String: Any] | Alert content. See [alert Dictionary](#user-message-alert-dictionary) below |
  | badge           | Int            | Badge count. Example: `1`                                                   |
  | sound           | String         | Notification sound. Example: `"default"`                                    |
  | mutable-content | Int            | Enables notification modification. Example: `1`                             |

  <span id="user-message-alert-dictionary" />

  **alert Dictionary:**

  | Parameter | Type   | Description                                    |
  | --------- | ------ | ---------------------------------------------- |
  | title     | String | Notification title. Example: `"Andrew Joseph"` |
  | body      | String | Notification body. Example: `"Hello there!"`   |
</Accordion>

<Accordion title="Sample Payload - Group Message Push Notification">
  **userInfo Dictionary Structure (Group Message):**

  | Parameter | Type           | Description                                                                                              |
  | --------- | -------------- | -------------------------------------------------------------------------------------------------------- |
  | message   | \[String: Any] | Message dictionary containing message details. See [message Dictionary](#group-message-dictionary) below |
  | aps       | \[String: Any] | Apple Push Notification Service payload. See [aps Dictionary](#group-message-aps-dictionary) below       |

  <span id="group-message-dictionary" />

  **message Dictionary:**

  | Parameter      | Type           | Description                                                                                 |
  | -------------- | -------------- | ------------------------------------------------------------------------------------------- |
  | id             | Int            | Unique message identifier. Example: `12346`                                                 |
  | muid           | String         | Message unique ID. Example: `"muid_abc456"`                                                 |
  | category       | String         | Message category. Example: `"message"`                                                      |
  | type           | String         | Message type. Example: `"text"`                                                             |
  | text           | String         | Message content. Example: `"Hey team!"`                                                     |
  | sender         | \[String: Any] | Sender user details. See [sender Dictionary](#group-message-sender-dictionary) below        |
  | receiver       | \[String: Any] | Receiver group details. See [receiver Dictionary](#group-message-receiver-dictionary) below |
  | receiverType   | String         | Receiver type. Example: `"group"`                                                           |
  | sentAt         | Int            | Unix timestamp. Example: `1699800000`                                                       |
  | deliveredAt    | Int            | Delivery timestamp. Example: `0`                                                            |
  | readAt         | Int            | Read timestamp. Example: `0`                                                                |
  | conversationId | String         | Conversation ID. Example: `"group_cometchat-guid-1"`                                        |

  <span id="group-message-sender-dictionary" />

  **sender Dictionary:**

  | Parameter    | Type   | Description                                                      |
  | ------------ | ------ | ---------------------------------------------------------------- |
  | uid          | String | Sender's unique ID. Example: `"cometchat-uid-1"`                 |
  | name         | String | Sender's display name. Example: `"Andrew Joseph"`                |
  | avatar       | String | Sender's avatar URL. Example: `"https://example.com/avatar.png"` |
  | status       | String | User online status. Example: `"online"`                          |
  | role         | String | User role. Example: `"default"`                                  |
  | lastActiveAt | Int    | Last active timestamp. Example: `1699799000`                     |

  <span id="group-message-receiver-dictionary" />

  **receiver Dictionary (Group):**

  | Parameter    | Type   | Description                                                  |
  | ------------ | ------ | ------------------------------------------------------------ |
  | guid         | String | Group's unique ID. Example: `"cometchat-guid-1"`             |
  | name         | String | Group's display name. Example: `"Development Team"`          |
  | icon         | String | Group's icon URL. Example: `"https://example.com/group.png"` |
  | type         | String | Group type. Example: `"public"`                              |
  | membersCount | Int    | Number of members. Example: `15`                             |
  | owner        | String | Group owner UID. Example: `"cometchat-uid-1"`                |
  | createdAt    | Int    | Creation timestamp. Example: `1699700000`                    |
  | hasJoined    | Bool   | Whether user has joined. Example: `true`                     |

  <span id="group-message-aps-dictionary" />

  **aps Dictionary:**

  | Parameter       | Type           | Description                                                                  |
  | --------------- | -------------- | ---------------------------------------------------------------------------- |
  | alert           | \[String: Any] | Alert content. See [alert Dictionary](#group-message-alert-dictionary) below |
  | badge           | Int            | Badge count. Example: `1`                                                    |
  | sound           | String         | Notification sound. Example: `"default"`                                     |
  | mutable-content | Int            | Enables notification modification. Example: `1`                              |

  <span id="group-message-alert-dictionary" />

  **alert Dictionary:**

  | Parameter | Type   | Description                                              |
  | --------- | ------ | -------------------------------------------------------- |
  | title     | String | Notification title. Example: `"Development Team"`        |
  | body      | String | Notification body. Example: `"Andrew Joseph: Hey team!"` |
</Accordion>

<Accordion title="Sample Payload - CometChat.processMessage() Output">
  **Method Signature:**

  | Parameter | Type                                | Description                              |
  | --------- | ----------------------------------- | ---------------------------------------- |
  | Input     | \[String: Any]                      | Push notification message dictionary     |
  | Returns   | (BaseMessage?, CometChatException?) | Tuple containing parsed message or error |

  **Return Tuple Structure:**

  | Index | Type                | Description                                                                        |
  | ----- | ------------------- | ---------------------------------------------------------------------------------- |
  | 0     | BaseMessage?        | Parsed message object. See [TextMessage Object](#processmessage-textmessage) below |
  | 1     | CometChatException? | Error object if parsing fails. `nil` on success                                    |

  <span id="processmessage-textmessage" />

  **[TextMessage](/sdk/ios/send-message#text-message) Object Properties (when type is "text"):**

  | Parameter       | Type                                                                                                  | Description                                                                |
  | --------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
  | id              | Int                                                                                                   | Message ID. Example: `12345`                                               |
  | muid            | String                                                                                                | Message unique ID. Example: `"muid_xyz123"`                                |
  | messageCategory | [MessageCategory](/sdk/ios/messaging-overview#message-category)                                       | Category enum. Example: `.message`                                         |
  | messageType     | [MessageType](/sdk/ios/messaging-overview#message-type)                                               | Type enum. Example: `.text`                                                |
  | text            | String                                                                                                | Message text content. Example: `"Hello there!"`                            |
  | sender          | [User](/sdk/ios/users-overview#user-properties)                                                       | Sender user object. See [sender Object](#processmessage-sender) below      |
  | receiver        | [User](/sdk/ios/users-overview#user-properties) or [Group](/sdk/ios/groups-overview#group-properties) | Receiver object. See [receiver Object](#processmessage-receiver) below     |
  | receiverType    | [ReceiverType](/sdk/ios/messaging-overview#receiver-type)                                             | Type of receiver. Example: `.user` or `.group`                             |
  | sentAt          | Int                                                                                                   | Unix timestamp. Example: `1699800000`                                      |
  | deliveredAt     | Int                                                                                                   | Delivery timestamp. Example: `0`                                           |
  | readAt          | Int                                                                                                   | Read timestamp. Example: `0`                                               |
  | conversationId  | String                                                                                                | Conversation identifier. Example: `"cometchat-uid-1_user_cometchat-uid-2"` |
  | editedAt        | Int                                                                                                   | Edit timestamp. Example: `0`                                               |
  | editedBy        | String?                                                                                               | Editor UID. Example: `nil`                                                 |
  | deletedAt       | Int                                                                                                   | Deletion timestamp. Example: `0`                                           |
  | deletedBy       | String?                                                                                               | Deleter UID. Example: `nil`                                                |

  <span id="processmessage-sender" />

  **sender [User](/sdk/ios/users-overview#user-properties) Object:**

  | Parameter    | Type                                              | Description                                                    |
  | ------------ | ------------------------------------------------- | -------------------------------------------------------------- |
  | uid          | String                                            | User's unique ID. Example: `"cometchat-uid-1"`                 |
  | name         | String                                            | User's display name. Example: `"Andrew Joseph"`                |
  | avatar       | String?                                           | User's avatar URL. Example: `"https://example.com/avatar.png"` |
  | status       | [UserStatus](/sdk/ios/users-overview#user-status) | Online status. Example: `.online`                              |
  | role         | String                                            | User role. Example: `"default"`                                |
  | lastActiveAt | Int                                               | Last active timestamp. Example: `1699799000`                   |

  <span id="processmessage-receiver" />

  **receiver Object (User or Group):**

  When receiverType is `.user`:

  | Parameter | Type                                              | Description                                                     |
  | --------- | ------------------------------------------------- | --------------------------------------------------------------- |
  | uid       | String                                            | User's unique ID. Example: `"cometchat-uid-2"`                  |
  | name      | String                                            | User's display name. Example: `"Jane Smith"`                    |
  | avatar    | String?                                           | User's avatar URL. Example: `"https://example.com/avatar2.png"` |
  | status    | [UserStatus](/sdk/ios/users-overview#user-status) | Online status. Example: `.offline`                              |

  When receiverType is `.group`:

  | Parameter    | Type                                             | Description                                                  |
  | ------------ | ------------------------------------------------ | ------------------------------------------------------------ |
  | guid         | String                                           | Group's unique ID. Example: `"cometchat-guid-1"`             |
  | name         | String                                           | Group's display name. Example: `"Development Team"`          |
  | icon         | String?                                          | Group's icon URL. Example: `"https://example.com/group.png"` |
  | groupType    | [GroupType](/sdk/ios/groups-overview#group-type) | Group type. Example: `.public`                               |
  | membersCount | Int                                              | Number of members. Example: `15`                             |

  **[MessageCategory](/sdk/ios/messaging-overview#message-category) Enum Values:**

  | Value    | Description                                |
  | -------- | ------------------------------------------ |
  | .message | Regular message (text, media, etc.)        |
  | .action  | Action message (member joined, left, etc.) |
  | .call    | Call message                               |
  | .custom  | Custom message type                        |

  **[ReceiverType](/sdk/ios/messaging-overview#receiver-type) Enum Values:**

  | Value  | Description             |
  | ------ | ----------------------- |
  | .user  | One-to-one conversation |
  | .group | Group conversation      |
</Accordion>

## Step 2. Launch Chat Window

You can launch the chat window from your base view controller after you tap on the Message Notification. This method uses NotificationCenter to trigger and present a chat window.

1. In this method you need to fire notification after you receive the `User` or `Group` Object.
2. In Notification's user info you can pass `User` or` Group` Object to that desired notification.

### Trigger notification from App Delegate

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    if let message = baseMessage as? BaseMessage {
      switch baseMessage.receiverType {
        case .user:
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
           if let user = baseMessage.sender {
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "didReceivedMessageFromUser"), object: nil, userInfo: ["user":user])
           }
         }
        case .group:
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
          if let group = baseMessage.receiver as? Group {
            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "didReceivedMessageFromGroup"), object: nil, userInfo: ["group":group])
           }
          }
        @unknown default: break
      }
    }
    ```
  </Tab>
</Tabs>

<Accordion title="Sample Payload - NotificationCenter POST (User Message)">
  **NotificationCenter.default.post() Method Parameters:**

  | Parameter | Type                 | Description                                                                                          |
  | --------- | -------------------- | ---------------------------------------------------------------------------------------------------- |
  | name      | NSNotification.Name  | Notification identifier name. Example: `NSNotification.Name(rawValue: "didReceivedMessageFromUser")` |
  | object    | Any?                 | Sender object (typically nil). Example: `nil`                                                        |
  | userInfo  | \[AnyHashable: Any]? | Dictionary containing user data. See [userInfo Dictionary](#notificationcenter-userinfo-user) below  |

  <span id="notificationcenter-userinfo-user" />

  **userInfo Dictionary Structure:**

  | Parameter | Type                                            | Description                                                                      |
  | --------- | ----------------------------------------------- | -------------------------------------------------------------------------------- |
  | user      | [User](/sdk/ios/users-overview#user-properties) | The sender User object. See [User Object](#notificationcenter-user-object) below |

  <span id="notificationcenter-user-object" />

  **[User](/sdk/ios/users-overview#user-properties) Object Properties:**

  | Parameter    | Type                                              | Description                                                    |
  | ------------ | ------------------------------------------------- | -------------------------------------------------------------- |
  | uid          | String                                            | User's unique ID. Example: `"cometchat-uid-1"`                 |
  | name         | String                                            | User's display name. Example: `"Andrew Joseph"`                |
  | avatar       | String?                                           | User's avatar URL. Example: `"https://example.com/avatar.png"` |
  | link         | String?                                           | User's profile link. Example: `nil`                            |
  | status       | [UserStatus](/sdk/ios/users-overview#user-status) | Online status. Example: `.online`                              |
  | role         | String                                            | User role. Example: `"default"`                                |
  | lastActiveAt | Int                                               | Last active timestamp. Example: `1699799000`                   |
  | hasBlockedMe | Bool                                              | Whether user has blocked current user. Example: `false`        |
  | blockedByMe  | Bool                                              | Whether current user has blocked this user. Example: `false`   |
  | metadata     | \[String: Any]?                                   | Custom metadata. Example: `nil`                                |
  | tags         | \[String]?                                        | User tags. Example: `[]`                                       |

  **[UserStatus](/sdk/ios/users-overview#user-status) Enum Values:**

  | Value      | Description              |
  | ---------- | ------------------------ |
  | .online    | User is currently online |
  | .offline   | User is offline          |
  | .available | User is available        |

  **Notification Dispatch Flow:**

  | Step | Action             | Description                                             |
  | ---- | ------------------ | ------------------------------------------------------- |
  | 1    | Check receiverType | `baseMessage.receiverType == .user`                     |
  | 2    | Extract sender     | `baseMessage.sender`                                    |
  | 3    | Delay              | `DispatchQueue.main.asyncAfter(deadline: .now() + 0.5)` |
  | 4    | Post               | `NotificationCenter.default.post(...)`                  |
</Accordion>

<Accordion title="Sample Payload - NotificationCenter POST (Group Message)">
  **NotificationCenter.default.post() Method Parameters:**

  | Parameter | Type                 | Description                                                                                           |
  | --------- | -------------------- | ----------------------------------------------------------------------------------------------------- |
  | name      | NSNotification.Name  | Notification identifier name. Example: `NSNotification.Name(rawValue: "didReceivedMessageFromGroup")` |
  | object    | Any?                 | Sender object (typically nil). Example: `nil`                                                         |
  | userInfo  | \[AnyHashable: Any]? | Dictionary containing group data. See [userInfo Dictionary](#notificationcenter-userinfo-group) below |

  <span id="notificationcenter-userinfo-group" />

  **userInfo Dictionary Structure:**

  | Parameter | Type                                               | Description                                                                           |
  | --------- | -------------------------------------------------- | ------------------------------------------------------------------------------------- |
  | group     | [Group](/sdk/ios/groups-overview#group-properties) | The receiver Group object. See [Group Object](#notificationcenter-group-object) below |

  <span id="notificationcenter-group-object" />

  **[Group](/sdk/ios/groups-overview#group-properties) Object Properties:**

  | Parameter    | Type                                                 | Description                                                  |
  | ------------ | ---------------------------------------------------- | ------------------------------------------------------------ |
  | guid         | String                                               | Group's unique ID. Example: `"cometchat-guid-1"`             |
  | name         | String                                               | Group's display name. Example: `"Development Team"`          |
  | icon         | String?                                              | Group's icon URL. Example: `"https://example.com/group.png"` |
  | description  | String?                                              | Group description. Example: `"Team discussions"`             |
  | groupType    | [GroupType](/sdk/ios/groups-overview#group-type)     | Group type. Example: `.public`                               |
  | membersCount | Int                                                  | Number of members. Example: `15`                             |
  | owner        | String                                               | Group owner UID. Example: `"cometchat-uid-1"`                |
  | createdAt    | Int                                                  | Creation timestamp. Example: `1699700000`                    |
  | updatedAt    | Int                                                  | Last update timestamp. Example: `1699750000`                 |
  | hasJoined    | Bool                                                 | Whether current user has joined. Example: `true`             |
  | joinedAt     | Int                                                  | Join timestamp. Example: `1699710000`                        |
  | scope        | [MemberScope](/sdk/ios/groups-overview#member-scope) | Current user's scope. Example: `.participant`                |
  | metadata     | \[String: Any]?                                      | Custom metadata. Example: `nil`                              |
  | tags         | \[String]?                                           | Group tags. Example: `[]`                                    |

  **[GroupType](/sdk/ios/groups-overview#group-type) Enum Values:**

  | Value     | Description               |
  | --------- | ------------------------- |
  | .public   | Anyone can join           |
  | .private  | Requires invitation       |
  | .password | Requires password to join |

  **[MemberScope](/sdk/ios/groups-overview#member-scope) Enum Values:**

  | Value        | Description              |
  | ------------ | ------------------------ |
  | .admin       | Administrator privileges |
  | .moderator   | Moderator privileges     |
  | .participant | Regular member           |

  **Notification Dispatch Flow:**

  | Step | Action             | Description                                             |
  | ---- | ------------------ | ------------------------------------------------------- |
  | 1    | Check receiverType | `baseMessage.receiverType == .group`                    |
  | 2    | Extract receiver   | `baseMessage.receiver as? Group`                        |
  | 3    | Delay              | `DispatchQueue.main.asyncAfter(deadline: .now() + 0.5)` |
  | 4    | Post               | `NotificationCenter.default.post(...)`                  |
</Accordion>

3. On the other hand, you need to observe for the above notification in your base view controller.

<Warning>
  1) Base view controller is a controller that launches immediately after the app delegate.
  2) Base view controller should be present to observe the notification when notification fires.
  3) If the view controller is not present in the memory when a new notification receives, then it won't launch Chat Window.
</Warning>

### Observe notification in Base View Controller

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    class BaseViewController : UIViewController {
      
      override func viewDidLoad() {
       NotificationCenter.default.addObserver(self, selector:#selector(self.didReceivedMessageFromGroup(_:)), name: NSNotification.Name(rawValue: "didReceivedMessageFromGroup"), object: nil)
            NotificationCenter.default.addObserver(self, selector:#selector(self.didReceivedMessageFromUser(_:)), name: NSNotification.Name(rawValue: "didReceivedMessageFromUser"), object: nil)
      }
    }
    ```
  </Tab>
</Tabs>

### Add selector method & Launch Chat Window

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
      @objc func didReceivedMessageFromGroup(_ notification: NSNotification) {
            if let group = notification.userInfo?["group"] as? Group {
                DispatchQueue.main.async {
                 let messageList = CometChatMessageList()
                 let navigationController = UINavigationController(rootViewController:messageList)
                  messageList.set(conversationWith: group, type: .group)
                  self.present(navigationController, animated:true, completion:nil)
                }
            }
        }
        
        @objc func didReceivedMessageFromUser(_ notification: NSNotification) {
              print("didReceivedMessageFromUser")
            if let user = notification.userInfo?["user"] as? User {
                DispatchQueue.main.async {
                 let messageList = CometChatMessageList()
                 let navigationController = UINavigationController(rootViewController:messageList)
                  messageList.set(conversationWith: user, type: .user)
                  self.present(navigationController, animated:true, completion:nil)
                }
            }
        }
    ```
  </Tab>
</Tabs>

<Accordion title="Sample Payload - didReceivedMessageFromGroup Notification">
  **NSNotification Object Structure:**

  | Parameter | Type                 | Description                                                                                              |
  | --------- | -------------------- | -------------------------------------------------------------------------------------------------------- |
  | name      | NSNotification.Name  | Notification identifier. Example: `"didReceivedMessageFromGroup"`                                        |
  | object    | Any?                 | Sender object. Example: `nil`                                                                            |
  | userInfo  | \[AnyHashable: Any]? | Dictionary containing group data. See [userInfo Dictionary](#didreceivedmessagefromgroup-userinfo) below |

  <span id="didreceivedmessagefromgroup-userinfo" />

  **userInfo Dictionary:**

  | Parameter | Type                                               | Description                                                                                      |
  | --------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
  | group     | [Group](/sdk/ios/groups-overview#group-properties) | The Group object from notification. See [Group Object](#didreceivedmessagefromgroup-group) below |

  <span id="didreceivedmessagefromgroup-group" />

  **[Group](/sdk/ios/groups-overview#group-properties) Object Properties:**

  | Parameter    | Type                                                 | Description                                                  |
  | ------------ | ---------------------------------------------------- | ------------------------------------------------------------ |
  | guid         | String                                               | Group's unique ID. Example: `"cometchat-guid-1"`             |
  | name         | String                                               | Group's display name. Example: `"Development Team"`          |
  | icon         | String?                                              | Group's icon URL. Example: `"https://example.com/group.png"` |
  | description  | String?                                              | Group description. Example: `"Team discussions"`             |
  | groupType    | [GroupType](/sdk/ios/groups-overview#group-type)     | Group type. Example: `.public`                               |
  | membersCount | Int                                                  | Number of members. Example: `15`                             |
  | owner        | String                                               | Group owner UID. Example: `"cometchat-uid-1"`                |
  | createdAt    | Int                                                  | Creation timestamp. Example: `1699700000`                    |
  | hasJoined    | Bool                                                 | Whether current user has joined. Example: `true`             |
  | scope        | [MemberScope](/sdk/ios/groups-overview#member-scope) | Current user's scope. Example: `.participant`                |

  **CometChatMessageList Configuration:**

  | Parameter                   | Type                  | Description                      |
  | --------------------------- | --------------------- | -------------------------------- |
  | set(conversationWith:type:) | (Group, ReceiverType) | Method to set group conversation |

  **set(conversationWith:type:) Parameters:**

  | Parameter        | Type                                                      | Description                                |
  | ---------------- | --------------------------------------------------------- | ------------------------------------------ |
  | conversationWith | [Group](/sdk/ios/groups-overview#group-properties)        | The Group object to open conversation with |
  | type             | [ReceiverType](/sdk/ios/messaging-overview#receiver-type) | Receiver type. Example: `.group`           |

  **Selector Method Flow:**

  | Step | Action     | Description                                               |
  | ---- | ---------- | --------------------------------------------------------- |
  | 1    | Extract    | `notification.userInfo?["group"] as? Group`               |
  | 2    | Dispatch   | `DispatchQueue.main.async { ... }`                        |
  | 3    | Initialize | `let messageList = CometChatMessageList()`                |
  | 4    | Wrap       | `UINavigationController(rootViewController: messageList)` |
  | 5    | Configure  | `messageList.set(conversationWith: group, type: .group)`  |
  | 6    | Present    | `self.present(navigationController, animated: true)`      |
</Accordion>

<Accordion title="Sample Payload - didReceivedMessageFromUser Notification">
  **NSNotification Object Structure:**

  | Parameter | Type                 | Description                                                                                            |
  | --------- | -------------------- | ------------------------------------------------------------------------------------------------------ |
  | name      | NSNotification.Name  | Notification identifier. Example: `"didReceivedMessageFromUser"`                                       |
  | object    | Any?                 | Sender object. Example: `nil`                                                                          |
  | userInfo  | \[AnyHashable: Any]? | Dictionary containing user data. See [userInfo Dictionary](#didreceivedmessagefromuser-userinfo) below |

  <span id="didreceivedmessagefromuser-userinfo" />

  **userInfo Dictionary:**

  | Parameter | Type                                            | Description                                                                                  |
  | --------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------- |
  | user      | [User](/sdk/ios/users-overview#user-properties) | The User object from notification. See [User Object](#didreceivedmessagefromuser-user) below |

  <span id="didreceivedmessagefromuser-user" />

  **[User](/sdk/ios/users-overview#user-properties) Object Properties:**

  | Parameter    | Type                                              | Description                                                    |
  | ------------ | ------------------------------------------------- | -------------------------------------------------------------- |
  | uid          | String                                            | User's unique ID. Example: `"cometchat-uid-1"`                 |
  | name         | String                                            | User's display name. Example: `"Andrew Joseph"`                |
  | avatar       | String?                                           | User's avatar URL. Example: `"https://example.com/avatar.png"` |
  | link         | String?                                           | User's profile link. Example: `nil`                            |
  | status       | [UserStatus](/sdk/ios/users-overview#user-status) | Online status. Example: `.online`                              |
  | role         | String                                            | User role. Example: `"default"`                                |
  | lastActiveAt | Int                                               | Last active timestamp. Example: `1699799000`                   |
  | hasBlockedMe | Bool                                              | Whether user has blocked current user. Example: `false`        |
  | blockedByMe  | Bool                                              | Whether current user has blocked this user. Example: `false`   |

  **CometChatMessageList Configuration:**

  | Parameter                   | Type                 | Description                     |
  | --------------------------- | -------------------- | ------------------------------- |
  | set(conversationWith:type:) | (User, ReceiverType) | Method to set user conversation |

  **set(conversationWith:type:) Parameters:**

  | Parameter        | Type                                                      | Description                               |
  | ---------------- | --------------------------------------------------------- | ----------------------------------------- |
  | conversationWith | [User](/sdk/ios/users-overview#user-properties)           | The User object to open conversation with |
  | type             | [ReceiverType](/sdk/ios/messaging-overview#receiver-type) | Receiver type. Example: `.user`           |

  **Selector Method Flow:**

  | Step | Action     | Description                                               |
  | ---- | ---------- | --------------------------------------------------------- |
  | 1    | Extract    | `notification.userInfo?["user"] as? User`                 |
  | 2    | Dispatch   | `DispatchQueue.main.async { ... }`                        |
  | 3    | Initialize | `let messageList = CometChatMessageList()`                |
  | 4    | Wrap       | `UINavigationController(rootViewController: messageList)` |
  | 5    | Configure  | `messageList.set(conversationWith: user, type: .user)`    |
  | 6    | Present    | `self.present(navigationController, animated: true)`      |
</Accordion>
