Skip to main content
  • 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 · Push Notifications · UI Kit
This guide helps you launch a chat window from the UI Kit library on receiving a new message notification.
CometChat SDK & UI Kit both need to be configured before launching the chat window.

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

To present a chat window, you need a User or a Group object. You can grab this from the push notification payload using CometChat.processMessage().

Step 2. Launch Chat Window

Launch the chat window from your base view controller using NotificationCenter.
  1. Fire a notification after you receive the User or Group Object.
  2. Pass the User or Group Object in the notification’s user info.

Trigger notification from App Delegate

  1. Observe the notification in your base view controller.
  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.

Observe notification in Base View Controller

Add selector method & Launch Chat Window


Next Steps

Receive Messages

Handle incoming messages in real time

Push Notifications

Set up push notifications for your iOS app

Launch Call Screen

Open call screen from push notification tap

UI Kit Overview

Pre-built UI components for iOS