{"id":22420217,"url":"https://github.com/qiscus/qiscus-chat-sdk-ios-sample","last_synced_at":"2025-06-25T08:34:13.437Z","repository":{"id":64541623,"uuid":"160169807","full_name":"qiscus/qiscus-chat-sdk-ios-sample","owner":"qiscus","description":"Sample User Interface for Qiscus Chat SDK IOS","archived":false,"fork":false,"pushed_at":"2024-12-09T02:08:32.000Z","size":5186,"stargazers_count":8,"open_issues_count":1,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-07T14:51:31.573Z","etag":null,"topics":["api","chat","chat-sdk","ios","message","real-time","sample","swift"],"latest_commit_sha":null,"homepage":"http://qiscus.com/documentation","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qiscus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-03T09:59:31.000Z","updated_at":"2024-12-09T02:08:38.000Z","dependencies_parsed_at":"2024-04-30T09:32:34.988Z","dependency_job_id":"c564d66b-6ce8-4344-a2fc-6bf88d161aa3","html_url":"https://github.com/qiscus/qiscus-chat-sdk-ios-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qiscus/qiscus-chat-sdk-ios-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiscus%2Fqiscus-chat-sdk-ios-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiscus%2Fqiscus-chat-sdk-ios-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiscus%2Fqiscus-chat-sdk-ios-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiscus%2Fqiscus-chat-sdk-ios-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiscus","download_url":"https://codeload.github.com/qiscus/qiscus-chat-sdk-ios-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiscus%2Fqiscus-chat-sdk-ios-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261836014,"owners_count":23217146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","chat","chat-sdk","ios","message","real-time","sample","swift"],"created_at":"2024-12-05T16:18:17.715Z","updated_at":"2025-06-25T08:34:13.419Z","avatar_url":"https://github.com/qiscus.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qiscus Chat SDK IOS Sample UI \n\nThis repo is aimed to give an example on how to build a chat UI using Qiscus Chat SDK. Qiscus Chat Sample UI is built with full functionalities so that you can figure out the flow and main activities of common Chat apps. This sample app is built on top of Qiscus Chat SDK, for further feature you can figure out in our [docs](https://documentation.qiscus.com/chat-sdk-ios/introduction)\n\n## Screen Shots\nYou can see some of sample UI in this repository\n\n\u003cimg src=\"https://d1edrlpyc25xu0.cloudfront.net/kiwari-prod/image/upload/ogp4jg-vSN/Screen+Shot+2019-03-18+at+08.00.12.png\" alt=\"Chat Rooms\" width=\"240\"/\u003e\n\n\u003cimg src=\"https://d1edrlpyc25xu0.cloudfront.net/kiwari-prod/image/upload/NRrM6CSG5l/Screen+Shot+2019-03-18+at+08.05.08.png\" alt=\"Chat\" width=\"240\"/\u003e\n\n\u003cimg src=\"https://d1edrlpyc25xu0.cloudfront.net/kiwari-prod/image/upload/7W08U63Fg_/Screen+Shot+2019-03-18+at+08.06.21.png\" alt=\"New Chat\" width=\"240\"/\u003e\n\n\u003cimg src=\"https://d1edrlpyc25xu0.cloudfront.net/kiwari-prod/image/upload/98Aciulka3/Screen+Shot+2019-03-18+at+08.07.04.png\" alt=\"Chat Room Info\" width=\"240\"/\u003e\n\n## Requirements\n\n- iOS 9.0+\n- minimum Xcode 11.2\n- Swift 5\n\n## Dependency\n\n* Alamofire\n* AlamofireImage\n* SwiftyJSON\n* SimpleImageViewer\n* SDWebImage\n\n## How to Run\nTo run this app without push notification, no need follow this step, just do `pod install`, but if you need to run with push notification you should follow these steps.\n\n\u003eNote: swift4.2 branch for Swift 4.2, swift5 branch for Swift 5 xcode 10.x.x master branch for Swift 5+ xcode 11.x.x\n\n### Step 1 : Get Your APP ID\n\nFirstly, you need to create your application in dashboard, by accessing this link [dashboard](https://www.qiscus.com/dashboard/login). You can create more than one APP ID.\n\n### Step 2 : Install Qiscus Chat SDK\n\nQiscus Chat SDK requires minimum IOS  SDK 9, To integrate your app with Qiscus, it can be done in 2 steps. Firstly, you need to add dependency QiscusCore in your Podfile,\n\n```\npod 'QiscusCore'\n```\n\nSecondly, you need to pod install from terminal\n\n```\npod install\n```\n\n### Step 3 : Initialization Qiscus Chat SDK\n\nYou need to initiate your APP ID for your chat App before carry out to Authentication. Can be implemented in the initial startup. Here is how you can do that:\n\n```\nQiscusCore.setup(WithAppID: \"yourAppId\")\n```\n\n\u003e Note:  \nThe initialization should be called always . The best practise you can put in AppDelegate\n\n\n### Step 4 : Change Name in Bundle Identifier and Create Certificate\nYou need change name of bundle identifier and create your cert in [Apple Developer](https://developer.apple.com/account/)\n\n### Step 5: Setup Push Notification\n\nThe Qiscus Chat SDK receives pushes through both the Qiscus Chat SDK protocol and Apple Push Notification Service (APNS), depending on usage and other conditions. Default notification sent by Qiscus Chat SDK protocol. In order to enable your application to receive apple push notifications, some setup must be performed in both application and the Qiscus Dashboard.\n\nDo the following steps to setup push notifications:\n\n1. Create a Certificate Signing Request(CSR).\n2. Create a Push Notification SSL certificate in Apple Developer site.\n3. Export a p12 file and upload it to Qiscus Dashboard.\n4. Register a device token in Qiscus SDK and parse Qiscus APNS messages.\n\n#### Step Push Notification 1:  Create A Certificate Signing Request(CSR)\n\nOpen **Keychain Access** on your Mac (Applications -\u003e Utilities -\u003e Keychain Access). Select **Request a Certificate From a Certificate Authority**.\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns1.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\nIn the **Certificate Information** window, do the following:\n\n* In the **User Email Address** field, enter your email address.\n* In the **Common Name** field, create a name for your private key (for example, John Doe Dev Key).\n* The **CA Email Address** field must be left empty.\n* In the **Request is** group, select the **Saved to disk** option.\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns2.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n#### Step Push Notification 2: Create A Push Notification SSL Certificate In Apple Developer Site.\n\nLog in to the [Apple Developer Member Center](https://developer.apple.com/) and find the **Certificates, Identifiers \u0026 Profiles** menu. Select **App IDs**, find your target application, and click the **Edit** button.\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns3.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns4.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\nTurn on **Push Notifications** and create a development or production certificate to fit your purpose. \n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns5.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\nUpload the **CSR file** that you created in section (1) to complete this process. After doing so, download a **SSL certificate**.\nDouble-click the file and register it to your **login keychain.**\n\n\n#### Step Push Notification 3: Export A p12 File and Upload It To Qiscus Dashboard\n\nUnder the Keychain Access, click the Certificates category from the left menu. Find the Push SSL certificate you just registered and right-click it without expanding the certificate. Then select Export to save the file to your disk.\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns6.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns7.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns8.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\nThen, log in to the [dashboard](https://www.qiscus.com/dashboard/login) and upload your `.p12` file to the Push Notification section, under Settings.\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns9.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\nklik add and fill the form upload certificates\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns10.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n\n\u003e **Note:  \n**Example of this certificate for production, you need create cert Push Notification for development, and Export A p12 File and Upload It To Qiscus Dashboard if you run from Xcode\n\n#### Step Push Notification 4: Register A Device Token In Qiscus SDK And Parse Qiscus APNS Messages.   \n\nIn your app's AppDelegate, store your device token as a variable.\n\n```\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        if #available(iOS 10.0, *) {\n            // For iOS 10 display notification (sent via APNS)\n            UNUserNotificationCenter.current().delegate = self\n            \n            let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]\n            UNUserNotificationCenter.current().requestAuthorization(\n                options: authOptions,\n                completionHandler: {_, _ in })\n        } else {\n            let settings: UIUserNotificationSettings =\n                UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)\n            application.registerUserNotificationSettings(settings)\n        }\n        \n        application.registerForRemoteNotifications()\n        \n        return true\n    }\n```\n\n```\nfunc application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\n        \n        var tokenString: String = \"\"\n        for i in 0..\u003cdeviceToken.count {\n            tokenString += String(format: \"%02.2hhx\", deviceToken[i] as CVarArg)\n        }\n        print(\"token = \\(tokenString)\")\n        QiscusCore.shared.register(deviceToken: tokenString, onSuccess: { (response) in\n            //\n        }) { (error) in\n            //\n        }\n    }\n    \n\nfunc application(_ application: UIApplication, didReceive notification: UILocalNotification) {\n       print(\"AppDelegate. didReceive: \\(notification)\")\n}\n    \nfunc application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {\n        print(\"AppDelegate. didReceiveRemoteNotification: \\(userInfo)\")\n}\n    \nfunc application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -\u003e Void) {\n        print(\"AppDelegate. didReceiveRemoteNotification2: \\(userInfo)\")\n}\n\n// [START ios_10_message_handling]\n@available(iOS 10, *)\nextension AppDelegate : UNUserNotificationCenterDelegate {\n    \n    // Receive displayed notifications for iOS 10 devices.\n    func userNotificationCenter(_ center: UNUserNotificationCenter,\n                                willPresent notification: UNNotification,\n                                withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -\u003e Void) {\n        let userInfo = notification.request.content.userInfo\n        \n        // Print full message.\n        print(userInfo)\n    }\n    \n    func userNotificationCenter(_ center: UNUserNotificationCenter,\n                                didReceive response: UNNotificationResponse,\n                                withCompletionHandler completionHandler: @escaping () -\u003e Void) {\n        let userInfo = response.notification.request.content.userInfo\n        \n        \n        // Print full message.\n        print(userInfo)\n        \n        completionHandler()\n    }\n}\n// [END ios_10_message_handling]\n```\n\nDon't forget set **Remote notifications and Background fetch** in menu **Capabilities**\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d3p8ijl4igpb16.cloudfront.net/docs/assets/apns11.png\" width=\"100%\" /\u003e\u003cbr/\u003e\u003c/p\u003e\n\n#### Step Push Notification 6: Test PN from third party\n\nfor example using tool Easy APNs Provider :\n\n\u003cp align=\"center\"\u003e\u003cbr/\u003e\u003cimg src=\"https://d1edrlpyc25xu0.cloudfront.net/kiwari-prod/image/upload/MZukRQrLqf/Screen+Shot+2019-03-20+at+11.02.14.png\" width=\"100%\"/\u003e\u003cbr/\u003e\u003c/p\u003e\n\n\u003e **Note:  \n**Follow step 1 - 6 tools to test push notification.\n**We test using cert Apple Development IOS Push Service\n\n\n## Contribution\nQiscus Chat SDK Sample UI is fully open-source. All contributions and suggestions are welcome!\n\n## Security Disclosure\n\nIf you believe you have identified a security vulnerability with Qiscus Chat SDK, you should report it as soon as possible via email to contact.us@qiscus.com. Please do not post it to a public issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiscus%2Fqiscus-chat-sdk-ios-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiscus%2Fqiscus-chat-sdk-ios-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiscus%2Fqiscus-chat-sdk-ios-sample/lists"}