{"id":13338750,"url":"https://github.com/rudderlabs/rudder-sdk-ios","last_synced_at":"2025-04-06T01:08:44.152Z","repository":{"id":37734583,"uuid":"212889382","full_name":"rudderlabs/rudder-sdk-ios","owner":"rudderlabs","description":"iOS SDK for RudderStack - the Customer Data Platform for Developers. Now supports tvOS, watchOS and macOS tracking!","archived":false,"fork":false,"pushed_at":"2025-04-02T13:49:21.000Z","size":5419,"stargazers_count":19,"open_issues_count":8,"forks_count":43,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-04-03T02:37:54.873Z","etag":null,"topics":["analytics","analytics-platform","ios","ios-library","ios-swift","open-source","rudder","sdk","swift","tvos"],"latest_commit_sha":null,"homepage":"https://www.rudderstack.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudderlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-04T19:35:09.000Z","updated_at":"2025-04-02T13:48:40.000Z","dependencies_parsed_at":"2023-12-20T15:26:45.517Z","dependency_job_id":"4412bd10-50fc-4fc3-8fc6-81594f4ccfa2","html_url":"https://github.com/rudderlabs/rudder-sdk-ios","commit_stats":{"total_commits":408,"total_committers":22,"mean_commits":"18.545454545454547","dds":0.8186274509803921,"last_synced_commit":"dcf152d5e7b8a0a715d20dbf813168cdbf46f99c"},"previous_names":[],"tags_count":141,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudderlabs","download_url":"https://codeload.github.com/rudderlabs/rudder-sdk-ios/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"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":["analytics","analytics-platform","ios","ios-library","ios-swift","open-source","rudder","sdk","swift","tvos"],"created_at":"2024-07-29T19:17:09.068Z","updated_at":"2025-04-06T01:08:44.145Z","avatar_url":"https://github.com/rudderlabs.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rudderstack.com/\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/59817155/121357083-1c571300-c94f-11eb-8cc7-ce6df13855c9.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003eThe Customer Data Platform for Developers\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cocoapods.org/pods/Rudder\"\u003e\n    \u003cimg src=\"https://img.shields.io/static/v1?label=pod\u0026message=v1.31.1\u0026color=blue\u0026style=flat\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\n    \u003ca href=\"https://rudderstack.com\"\u003eWebsite\u003c/a\u003e\n    ·\n    \u003ca href=\"https://rudderstack.com/docs/stream-sources/rudderstack-sdk-integration-guides/rudderstack-ios-sdk/\"\u003eDocumentation\u003c/a\u003e\n    ·\n    \u003ca href=\"https://rudderstack.com/join-rudderstack-slack-community\"\u003eCommunity Slack\u003c/a\u003e\n  \u003c/b\u003e\n\u003c/p\u003e\n\n---\n\n# RudderStack iOS SDK\n\nRudderStack's iOS SDK lets you track event data from your **iOS** and **tvOS** applications. After integrating the SDK, you will also be able to send these events to your preferred destinations such as Google Analytics, Amplitude, and more.\n\nFor detailed documentation on the iOS SDK, click [**here**](https://rudderstack.com/docs/stream-sources/rudderstack-sdk-integration-guides/rudderstack-ios-sdk).\n\n## Installing the iOS SDK\n\nThe iOS SDK is available through [**CocoaPods**](https://cocoapods.org), [**Carthage**](https://github.com/Carthage/Carthage), and [**Swift Package Manager (SPM)**](https://www.swift.org/package-manager/).\n\n### CocoaPods\n\nTo install the SDK, simply add the following line to your Podfile:\n\n```xcode\npod 'Rudder', '1.31.1'\n```\n\n### Carthage\n\nFor Carthage support, add the following line to your `Cartfile`:\n\n```xcode\ngithub \"rudderlabs/rudder-sdk-ios\" \"v1.31.1\"\n```\n\n\u003e Remember to include the following code in all `.m` and `.h` files where you want to refer to or use the RudderStack SDK classes, as shown:\n\n```xcode\n#import \u003cRudder/Rudder.h\u003e\n```\n\n### Swift Package Manager (SPM)\n\nYou can also add the RudderStack iOS SDK via Swift Package Mangaer, via one of the following two ways:\n\n* [Xcode](#xcode)\n* [Swift](#swift)\n\n#### Xcode\n\n* Go to **File** - **Add Package**, as shown:\n\n![Adding a package](https://user-images.githubusercontent.com/59817155/140903027-286a1d64-f5d5-4041-9827-47b6cef76a46.png)\n\n* Enter the package repository (`git@github.com:rudderlabs/rudder-sdk-ios.git`) in the search bar.\n\n* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.31.1` as the value, as shown:\n\n![Setting dependency](https://user-images.githubusercontent.com/59817155/145574696-8c849749-13e0-40d5-aacb-3fccb5c8e67d.png)\n\n* Select the project to which you want to add the package.\n\n* Finally, click on **Add Package**.\n\n#### Swift\n\nTo leverage package.swift, use the following snippet in your project:\n\n```swift\n// swift-tools-version:5.5\n// The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"RudderStack\",\n    products: [\n        // Products define the executables and libraries a package produces, and make them visible to other packages.\n        .library(\n            name: \"RudderStack\",\n            targets: [\"RudderStack\"]),\n    ],\n    dependencies: [\n        // Dependencies declare other packages that this package depends on.\n        .package(url: \"git@github.com:rudderlabs/rudder-sdk-ios.git\", from: \"1.31.1\")\n    ],\n    targets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages this package depends on.\n        .target(\n            name: \"RudderStack\",\n            dependencies: [\n                .product(name: \"Rudder\", package: \"rudder-sdk-ios\")\n            ]),\n        .testTarget(\n            name: \"RudderStackTests\",\n            dependencies: [\"RudderStack\"]),\n    ]\n)\n```\n\n## Initializing the RudderStack client\n\nTo the initialize `RSClient`, place the following code in your `AppDelegate.m` file under the method `didFinishLaunchingWithOptions`:\n\n```xcode\nRSConfigBuilder *builder = [[RSConfigBuilder alloc] init];\n[builder withDataPlaneUrl:\u003cDATA_PLANE_URL\u003e];\n[RSClient getInstance:\u003cWRITE_KEY\u003e config:[builder build]];\n```\nA shared instance of `RSClient` is accesible after the initialization by `[RSClient sharedInstance]`.\n\n## Sending Events\n\n### Track\n\n```xcode\n[[RSClient sharedInstance] track:@\"simple_track_event\"];\n[[RSClient sharedInstance] track:@\"simple_track_with_props\" properties:@{\n    @\"key_1\" : @\"value_1\",\n    @\"key_2\" : @\"value_2\"\n}];\n```\n\n### Screen\n\n```xcode\n[[RSClient sharedInstance] screen:@\"Main\" properties:@{@\"prop_key\" : @\"prop_value\"}];\n```\n\n### Identify\n\n```xcode\n[[RSClient sharedInstance] identify:@\"test_user_id\"\n                             traits:@{@\"foo\": @\"bar\",\n                                      @\"foo1\": @\"bar1\",\n                                      @\"email\": @\"test@gmail.com\"}\n];\n```\n\n### Group\n\n```xcode\n[[RSClient sharedInstance] group:@\"sample_group_id\"\n                          traits:@{@\"foo\": @\"bar\",\n                                   @\"foo1\": @\"bar1\",\n                                   @\"email\": @\"test@gmail.com\"}\n];\n```\n\n### Alias\n\n```xcode\n[[RSClient sharedInstance] alias:@\"new_user_id\"];\n```\n\n### Reset\n\n```xcode\n[[RSClient sharedInstance] reset];\n```\n\nFor detailed documentation on the iOS SDK, click [**here**](https://rudderstack.com/docs/stream-sources/rudderstack-sdk-integration-guides/rudderstack-ios-sdk).\n\n## Contribute\n\nWe would love to see you contribute to this project. Get more information on how to contribute [**here**](./CONTRIBUTING.md).\n\n## About RudderStack\n\n[**RudderStack**](https://rudderstack.com/) is a **customer data platform for developers**. Our tooling makes it easy to deploy pipelines that collect customer data from every app, website and SaaS platform, then activate it in your warehouse and business tools.\n\nMore information on RudderStack can be found [**here**](https://github.com/rudderlabs/rudder-server).\n\n## Contact us\n\nFor more information on using the RudderStack iOS SDK, you can [**contact us**](https://rudderstack.com/contact/) or start a conversation on our [**Slack**](https://rudderstack.com/join-rudderstack-slack-community) channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudderlabs%2Frudder-sdk-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-ios/lists"}