Push Notifications

Push Notification

To configure Firebase Push Notifications for CometChat create a firebase project at https://console.firebase.google.com/ and follow the steps below:

  1. Click on “Add Firebase to your iOS app” or “Add another app” option.

  2. Add Bundle id and app nickname of your app in popup window. Then click on “ADD APP” button located at bottom-below corner of popup window. After clicking on “ADD APP” button, GoogleService-Info.plist file will be downloaded on your machine. Complete steps by clicking on “CONTINUE” button in popup window.



  3. Go to iOS app settings by clicking on “settings” option in more settings menu(Vertical dotted icon)

  4. Select “CLOUD MESSAGING” tab in settings window. Upload .p12 Development and Distribution APNs certificate.

  5. Get the “Web API Key” to configure firebase push notification service from CometChat Admin Panel.

  6. Add the “Web API Key” as “Firebase server key” in CometChat Admin Panel under Settings -> Mobile tab

  7. Refer https://firebase.google.com/docs/notifications/ios/console-audience to configure your mobile app to receive the push notifications.

  8. You need to subscribe to a channel from where you will get the push notification. You will get this channel from the response received in onMyInfoReceived() callback in custom ui of iOS SDK. In case of Ready ui, you will get channel from the response received in userinfo callback of loginWithURL method. The response of callbacks contains a key named as “push_channel”. This contains the push notification channel. Once you subscribe to this channel, you will start receiving push notifications for one-on-one chat.

  9. For push notifications in chatroom,you will get “push_channel” from the response received in chatroominfo callback of loginWithUserID method. Once you subscribe to this channel, you will start receiving push notifications for the group.

  10. For push notifications in Announcement, you will get “push_an_channel” in response of onMyInfoReceived() callback in custom ui of iOS SDK respectively. In case of Ready ui, you will get “push_an_channel” from the response received in userinfo callback of loginWithURL method. Once you subscribe to this channel you will start receiving push notification for announcements sent from CometChat administration panel.

  • Was this helpful?
  • Yes   No