{"id":22264245,"url":"https://github.com/pushlytic/pushlytic-ios-sdk","last_synced_at":"2025-07-16T05:41:31.298Z","repository":{"id":264891342,"uuid":"894281387","full_name":"pushlytic/pushlytic-ios-sdk","owner":"pushlytic","description":"iOS SDK for Pushlytic, the modern push infrastructure platform","archived":false,"fork":false,"pushed_at":"2025-02-08T03:37:37.000Z","size":76,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:22:46.764Z","etag":null,"topics":["bidirectional","communication","grpc","ios","messaging","mobile","real-time","sdk","swift","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":"https://pushlytic.com","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/pushlytic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2024-11-26T04:39:28.000Z","updated_at":"2025-03-09T23:51:23.000Z","dependencies_parsed_at":"2025-02-08T04:20:49.003Z","dependency_job_id":"fd0e35a6-2c2e-4bb0-bd16-ca4fdd38296b","html_url":"https://github.com/pushlytic/pushlytic-ios-sdk","commit_stats":null,"previous_names":["pushlytic/pushlytic-ios-sdk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pushlytic/pushlytic-ios-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushlytic%2Fpushlytic-ios-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushlytic%2Fpushlytic-ios-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushlytic%2Fpushlytic-ios-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushlytic%2Fpushlytic-ios-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pushlytic","download_url":"https://codeload.github.com/pushlytic/pushlytic-ios-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushlytic%2Fpushlytic-ios-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265485377,"owners_count":23774476,"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":["bidirectional","communication","grpc","ios","messaging","mobile","real-time","sdk","swift","swift-package-manager","swiftui"],"created_at":"2024-12-03T10:08:16.517Z","updated_at":"2025-07-16T05:41:31.274Z","avatar_url":"https://github.com/pushlytic.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pushlytic iOS SDK\n\nA powerful iOS SDK for real-time communication using enabling seamless push messages and real-time interactions in your iOS applications.\n\n## Key Features\n- Real-time bidirectional streaming\n- User targeting with IDs, tags, and metadata\n- Customizable push messages with dynamic templates\n- Automatic connection management\n- Support for experiments and A/B testing\n\n## Requirements\n- iOS 13.0+\n- Swift 5.0+\n- Swift Package Manager\n\n## Installation\n\nGet started with Pushlytic in your iOS app - it's quick and easy! \n\n### Swift Package Manager\n1. Open Xcode and go to `File \u003e Add Packages...`\n2. Enter the package URL: `https://github.com/pushlytic/pushlytic-ios-sdk`\n3. Set the dependency rule to **Up to Next Minor Version**, starting at `0.1.2`\n4. Add the package to your desired target\n\n\u003e **Note**: We're rapidly improving Pushlytic! 🚀 During our pre-1.0 phase:\n\u003e - Minor version updates (0.x.0) may include exciting new features and improvements that could have breaking changes\n\u003e - Using \"Up to Next Minor\" ensures you get all bug fixes while maintaining stability\n\u003e - Once we hit 1.0.0, we'll follow strict semantic versioning with \"Up to Next Major Version\"\n\u003e\n\u003e Join us early and help shape the future of push infrastructure! Your feedback and use cases are invaluable as we move toward our 1.0.0 release.\n\n## Quick Start\n\n```swift\nimport SwiftUI\nimport Pushlytic\n\n@main\nstruct YourApp: App {\n    private let messagingDelegate: MessageHandler\n    \n    init() {\n        self.messagingDelegate = MessageHandler()\n        \n        // Initialize Pushlytic with delegate\n        Pushlytic.setDelegate(messagingDelegate)\n        Pushlytic.configure(with: Pushlytic.Configuration(apiKey: \"YOUR_API_KEY\"))\n    }\n    \n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n    }\n}\n```\n\n## Basic Usage\n\n### Stream Management\n```swift\n// Open a connection to start receiving messages\nPushlytic.openStream()\n\n// Later, when you want to stop receiving messages:\n// - Set clearState to false to allow automatic reconnection on app foreground\n// - Set clearState to true to clear all connection metadata and prevent automatic reconnection\nPushlytic.endStream(clearState: false)\n```\n\n### Set Up User Information\n```swift\n// Ensure the stream is opened before registering connection data\n// Open a connection to start receiving messages\nPushlytic.openStream()\n\n// You must open the stream first before registering connection data, such as user ID, tags, or metadata.\n// Register user ID\nPushlytic.registerUserID(\"unique_user_id\")\n\n// Add tags for targeting\nPushlytic.registerTags([\"premium_user\", \"electronics\"])\n\n// Set user metadata\nPushlytic.setMetadata([\n    \"first_name\": \"John\",\n    \"account_type\": \"premium\"\n])\n```\n\n### Handle Messages\n```swift\nclass MessageHandler: PushlyticDelegate {\n    func pushlytic(didReceiveMessage message: String) {\n        // Handle raw message string\n        print(\"Received message: \\(message)\")\n        \n        // Parse message into a custom type\n        struct CustomMessage: Codable {\n            let id: String\n            let content: String\n        }\n        \n        Pushlytic.parseMessage(message) { (customMessage: CustomMessage) in\n            print(\"Parsed message - ID: \\(customMessage.id), Content: \\(customMessage.content)\")\n        } errorHandler: { error in\n            print(\"Failed to decode message: \\(error)\")\n        }\n    }\n    \n    func pushlytic(didChangeConnectionStatus status: ConnectionStatus) {\n        switch status {\n        case .connected:\n            print(\"Connected to message stream\")\n        case .disconnected:\n            print(\"Disconnected from message stream\")\n        case .error(let error):\n            print(\"Connection error: \\(error)\")\n        case .timeout:\n            print(\"Connection timeout\")\n        }\n    }\n}\n```\n\n### Type-Safe Message Parsing\nThe SDK provides a convenient way to parse incoming JSON messages into Swift types:\n\n```swift\n// Define your message types\nstruct CustomMessage: Codable {\n    let id: String\n    let content: String\n    let metadata: MessageMetadata\n}\n\nstruct MessageMetadata: Codable {\n    let timestamp: Date\n    let priority: String\n}\n\n// Parse incoming messages\nPushlytic.parseMessage(jsonString) { (message: CustomMessage) in\n    // Access typed message properties\n    print(\"Message ID: \\(message.id)\")\n    print(\"Content: \\(message.content)\")\n    print(\"Timestamp: \\(message.metadata.timestamp)\")\n} errorHandler: { error in\n    print(\"Parsing error: \\(error)\")\n}\n```\n\n## Example App\nAn example app demonstrating usage of Pushlytic SDK features is available in the `Examples/` directory. It showcases:\n- Stream connection\n- Message handling\n- User segmentation\n- Metadata-driven personalization\n\n## Repository Structure\n- **Examples/**: Contains a fully functional example app demonstrating SDK usage\n- **Sources/**: Core SDK functionality\n- **Tests/**: Unit tests for SDK components\n\n## Contributing\nContributions are welcome! Please see the `CONTRIBUTING.md` file for guidelines on submitting issues, feature requests, and pull requests.\n\n## License\nPushlytic iOS SDK is available under the MIT License. See the `LICENSE` file for more information.\n\n## Security \u0026 Support\n- For security vulnerabilities, contact our security team at [security@pushlytic.com](mailto:security@pushlytic.com)\n- For general support, reach out to [support@pushlytic.com](mailto:support@pushlytic.com) or visit our [documentation site](https://pushlytic.com/docs)\n\n## Related Resources\n- [Pushlytic Android SDK](https://github.com/pushlytic/pushlytic-android-sdk)\n- [Pushlytic API Documentation](https://pushlytic.com/docs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushlytic%2Fpushlytic-ios-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushlytic%2Fpushlytic-ios-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushlytic%2Fpushlytic-ios-sdk/lists"}