Skip to content

ajayv-cometchat/ios-swift-chat-push-notification-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation





CometChat Push Notification Sample App (built using CometChat Pro SDK) is a fully functional push notification app capable of one-on-one (private) and group messaging as well as Calling. This sample app enables users to send and receive push notifications for text and multimedia messages like images, videos, documents as well as ** Custom Messages** . Also, users can make push notifications for Audio and Video calls to other users or groups.


Table of Contents

  1. Installation

  2. Running the sample app

  3. Add Push Notification inside your project

  4. Increment Badge Count

  5. Hide Push Notifications from Blocked Users

  6. Troubleshooting

Installation

  1. Simply clone the project from ios-swift-push-notification-app repository.

  2. After cloning the repository navigate & Select your push notification configuration. i.e Firebase or APNS + Callkit (Recomended).

  3. Use below command to install required pods.

$ pod install
  1. Create certificates for your bundle ID as per mentioned in our documentation.

  2. Build and run the Sample App.

Running the sample app

To Run to sample App you have to do the following changes by Adding APP_ID, API_KEYand REGION CODE and s user's UID for which you wants to send the push notification.

You can obtain your APP_ID and API_KEY from CometChat-Pro Dashboard

  • Enable to Push notification Extension from [CometChat-Pro Dashboard] . To Enable Push notification extension, please navigate to Extensions --> Push Notification --> Add Extension.



  • Add Title and Firebase Server Key received from Firebase Console.











  • Open the project in Xcode.

  • Go to CometChatPro-PushNotification-SampleApp --> Constants.swift.

  • modify apiKey and appID with your own apiKey and appID.

  • Enter toUserUID for which you wants to send the push notification.


Add Push Notification inside your project

  1. Add CometChat SDK.

We recommend using CocoaPods, as they are the most advanced way of managing iOS project dependencies. Open a terminal window, move to your project directory, and then update the SDK by running the following command.

$ pod install

If the pod installation fails due to Cocoapods dependancy issue then use the below command to install the framework through cocoapods.

 pod install --repo-update
  1. We are providing two ways to implement push notification for your app.

  2. Firebase

  3. APNS (Supports Callkit)

Please refer our documentation to intergrate push notification inside your app.

Note:

  1. Ignore firebase setup if you're using APNS based approach.
  2. Please add Callkit related code carefully to avoid issues.




Increment Badge Count

Learn more about how to Increment Badge Count using Notification service Extension.


Hide Push Notifications from Blocked Users

Learn more about how to hide push notification for blocked users using Notification service Extension.


Troubleshooting


Contributors

Thanks to the following people who have contributed to this project:

@pushpsenairekar2911 👨‍💻
@jeetkapadia 👨‍💻


Contact

Contact us via real time support present in CometChat Dashboard.


License


This project uses the following license.

About

Open-source Chat Push Notification App for Swift (iOS)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.9%
  • Other 0.1%