{"id":32146624,"url":"https://github.com/customerly/customerlyiossdk","last_synced_at":"2025-10-21T08:17:23.481Z","repository":{"id":294474756,"uuid":"982952581","full_name":"Customerly/CustomerlyiOSSDK","owner":"Customerly","description":"Embed the Best-in-Class Live Chat for your iOS apps with Customerly mobile SDK","archived":false,"fork":false,"pushed_at":"2025-08-26T15:56:31.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-01T00:08:26.848Z","etag":null,"topics":["customer-care","customer-support","customerly","ios","live-chat","messaging","messenger","sdk","xcode"],"latest_commit_sha":null,"homepage":"https://www.customerly.io/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Customerly.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,"zenodo":null}},"created_at":"2025-05-13T16:44:00.000Z","updated_at":"2025-08-26T15:56:19.000Z","dependencies_parsed_at":"2025-05-20T16:06:23.025Z","dependency_job_id":"2e74e754-36d7-44bc-9080-9b6a5ef5252e","html_url":"https://github.com/Customerly/CustomerlyiOSSDK","commit_stats":null,"previous_names":["customerly/customerlyiossdk"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Customerly/CustomerlyiOSSDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Customerly%2FCustomerlyiOSSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Customerly%2FCustomerlyiOSSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Customerly%2FCustomerlyiOSSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Customerly%2FCustomerlyiOSSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Customerly","download_url":"https://codeload.github.com/Customerly/CustomerlyiOSSDK/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Customerly%2FCustomerlyiOSSDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280225968,"owners_count":26293913,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["customer-care","customer-support","customerly","ios","live-chat","messaging","messenger","sdk","xcode"],"created_at":"2025-10-21T08:17:19.585Z","updated_at":"2025-10-21T08:17:23.476Z","avatar_url":"https://github.com/Customerly.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://customerly.io\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://avatars1.githubusercontent.com/u/23583405?s=200\u0026v=4\" height=\"100\" alt=\"Customerly logo\"\u003e\n\u003c/a\u003e\n\n# Customerly iOS SDK\n\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)]()\n[![CocoaPods](https://img.shields.io/cocoapods/v/Customerly.svg)]()\n![GitHub License](https://img.shields.io/github/license/Customerly/CustomerlyiOSSDK)\n\nCustomerly is a customer service platform that helps businesses provide better support to their customers. The iOS SDK allows you to integrate Customerly's features directly into your iOS application, including:\n\n- Live chat support\n- Help center articles\n- User profiling\n- Event tracking\n- Lead generation\n- Surveys\n- Real-time video calls\n\n## Installation\n\n### Swift Package Manager\n\nAdd the following dependency to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/customerly/CustomerlyiOSSDK.git\", from: \"1.0.5\")\n]\n```\n\n### CocoaPods\n\nAdd the following line to your Podfile:\n\n```ruby\npod 'Customerly'\n```\n\nThen run:\n\n```bash\npod install\n```\n\n## Basic Usage\n\n### `CustomerlyView`\nA SwiftUI view that integrates the Customerly messenger into your app. It initializes the SDK with the settings provided and attaches the SDK to the SwiftUI view hierarchy.\n\n\u003e **Important**: The SDK requires two initialization steps to work properly:\n\u003e 1. Calling `load(settings:)` to initialize the SDK\n\u003e 2. Providing a parent view controller either via `load(settings:parent:)` or `setParent(_:)`\n\u003e \n\u003e When using `CustomerlyView`, both requirements are automatically handled for you. If you're not using `CustomerlyView`, you must handle these requirements manually.\n\n```swift\nimport SwiftUI\nimport CustomerlySDK\n\n@main\nstruct SampleAppApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ZStack {\n                // Your app content here\n\n                CustomerlyView(settings: CustomerlySettings(app_id: \"YOUR_APP_ID\")).onAppear(){\n                    Customerly.shared.requestNotificationPermissionIfNeeded()\n                }\n            }\n        }\n    }\n}\n```\n\n### Handling notifications\n\nThe SDK will use the `UNUserNotificationCenter` to present local notifications when a new message is received. We suggest you to add an `AppDelegate` to handle the notifications and open the messenger when a notification is tapped.\n\n```swift\n// ...\nimport UserNotifications\n\nclass AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {\n    func application(_ application: UIApplication,\n                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -\u003e Bool {\n        UNUserNotificationCenter.current().delegate = self\n        return true\n    }\n\n    func userNotificationCenter(_ center: UNUserNotificationCenter,\n                                willPresent notification: UNNotification,\n                                withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -\u003e Void) {\n        completionHandler([.banner, .sound, .list])\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        if let conversationId = userInfo[\"conversationId\"] as? Int {\n            Customerly.shared.navigateToConversation(conversationId: conversationId)\n        }\n        Customerly.shared.show(withoutNavigation: true)\n        completionHandler()\n    }\n}\n\n@main\nstruct SampleAppApp: App {\n    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n\n    // ...\n}\n```\n\n## APIs\n\n### Initialization and Configuration\n\n#### load\nInitializes the Customerly SDK with the provided settings.\n\n```swift\nCustomerly.shared.load(settings: CustomerlySettings(app_id: \"YOUR_APP_ID\"), parent: self)\n```\n\n#### setParent\nSets a new parent view controller for presenting the messenger.\n\n```swift\nCustomerly.shared.setParent(self)\n```\n\n#### update\nUpdates the Customerly SDK settings.\n\n```swift\nCustomerly.shared.update(settings: CustomerlySettings(app_id: \"YOUR_APP_ID\"))\n```\n\n#### requestNotificationPermissionIfNeeded\nRequests notification permissions if not already granted.\n\n```swift\nCustomerly.shared.requestNotificationPermissionIfNeeded()\n```\n\n### Messenger Control\n\n#### show\nShows the Customerly chat interface.\n\n```swift\nCustomerly.shared.show(withoutNavigation: false)\n```\n\n#### hide\nHides the Customerly chat interface.\n\n```swift\nCustomerly.shared.hide()\n```\n\n#### back\nNavigates back in the chat interface.\n\n```swift\nCustomerly.shared.back()\n```\n\n### User Management\n\n#### logout\nLogs out the current user.\n\n```swift\nCustomerly.shared.logout()\n```\n\n#### registerLead\nRegisters a new lead with the provided email and optional attributes.\n\n```swift\nCustomerly.shared.registerLead(email: \"test@example.com\", attributes: [\"name\": \"John Doe\"])\n```\n\n### Messaging\n\n#### showNewMessage\nShows the chat interface with a pre-filled message.\n\n```swift\nCustomerly.shared.showNewMessage(message: \"Hello, how can I help you?\")\n```\n\n#### sendNewMessage\nSends a new message and shows the chat interface.\n\n```swift\nCustomerly.shared.sendNewMessage(message: \"Hello, how can I help you?\")\n```\n\n#### navigateToConversation\nNavigates to a specific conversation.\n\n```swift\nCustomerly.shared.navigateToConversation(conversationId: 123)\n```\n\n### Help Center\n\n#### showArticle\nShows a specific help center article.\n\n```swift\nCustomerly.shared.showArticle(collectionSlug: \"collection\", articleSlug: \"article\")\n```\n\n### Analytics\n\n#### event\nTracks a custom event.\n\n```swift\nCustomerly.shared.event(name: \"event_name\")\n```\n\n#### attribute\nSets a custom attribute for the current user.\n\n```swift\nCustomerly.shared.attribute(name: \"attribute_name\", value: \"attribute_value\")\n```\n\n### Message Counts\n\n#### getUnreadMessagesCount\nGets the count of unread messages.\n\n```swift\nCustomerly.shared.getUnreadMessagesCount(completion: { count in\n    print(\"Unread messages count: \\(count)\")\n})\n```\n\n#### getUnreadConversationsCount\nGets the count of unread conversations.\n\n```swift\nCustomerly.shared.getUnreadConversationsCount(completion: { count in\n    print(\"Unread conversations count: \\(count)\")\n})\n```\n\n### Callbacks\n\nThe SDK provides various callbacks for different events. Here are the main callback setters:\n\n```swift\nfunc setOnChatClosed(_ callback: @escaping () -\u003e Void)\nfunc setOnChatOpened(_ callback: @escaping () -\u003e Void)\nfunc setOnHelpCenterArticleOpened(_ callback: @escaping (HelpCenterArticle) -\u003e Void)\nfunc setOnLeadGenerated(_ callback: @escaping (String?) -\u003e Void)\nfunc setOnMessageRead(_ callback: @escaping (Int, Int) -\u003e Void)\nfunc setOnMessengerInitialized(_ callback: @escaping () -\u003e Void)\nfunc setOnNewConversation(_ callback: @escaping (String, [AttachmentPayload]) -\u003e Void)\nfunc setOnNewMessageReceived(_ callback: @escaping (UnreadMessage) -\u003e Void)\nfunc setOnNewConversationReceived(_ callback: @escaping (Int) -\u003e Void)\nfunc setOnProfilingQuestionAnswered(_ callback: @escaping (String, String) -\u003e Void)\nfunc setOnProfilingQuestionAsked(_ callback: @escaping (String) -\u003e Void)\nfunc setOnRealtimeVideoAnswered(_ callback: @escaping (RealtimeCall) -\u003e Void)\nfunc setOnRealtimeVideoCanceled(_ callback: @escaping () -\u003e Void)\nfunc setOnRealtimeVideoReceived(_ callback: @escaping (RealtimeCall) -\u003e Void)\nfunc setOnRealtimeVideoRejected(_ callback: @escaping () -\u003e Void)\nfunc setOnSurveyAnswered(_ callback: @escaping () -\u003e Void)\nfunc setOnSurveyPresented(_ callback: @escaping (Survey) -\u003e Void)\nfunc setOnSurveyRejected(_ callback: @escaping () -\u003e Void)\n```\n\nEach callback has a corresponding remove method:\n\n```swift\nfunc removeOnChatClosed()\nfunc removeOnChatOpened()\n// ... and so on for all callbacks\n```\n\nYou can also remove all callbacks at once:\n\n```swift\nfunc removeAllCallbacks()\n```\n\n## Examples\n\nThe repository includes a sample project (`SampleApp`) that demonstrates how to integrate and use the Customerly SDK in a SwiftUI application. The example shows:\n\n- Basic SDK initialization\n- Messenger presentation\n- User management\n- Event tracking\n- Message handling\n- Notification handling\n- Callback usage\n\nTo run the example:\n1. Open the project in Xcode\n2. Replace the `app_id` in `SampleAppApp.swift` with your Customerly app ID\n3. Build and run the project\n\nThe sample app provides a complete reference implementation of all SDK features and can be used as a starting point for your integration.\n\n\n## Development\n\nTo release a new version of the SDK, you need to:\n\n1. Update the version in the `Customerly.podspec` file\n2. Update the version in the `README.md` file\n3. Push the changes to the `main` branch\n4. Create a new tag with the version number (e.g. `1.0.0`). The tag must be in the format `v1.0.0`\n5. The GitHub Actions workflow will build the SDK and release it to CocoaPods\n\n## License\n\nThis SDK is licensed under the GNU GPLv3 License. See the LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomerly%2Fcustomerlyiossdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustomerly%2Fcustomerlyiossdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomerly%2Fcustomerlyiossdk/lists"}