{"id":21762085,"url":"https://github.com/segment-integrations/analytics-swift-localytics","last_synced_at":"2026-05-14T23:03:55.877Z","repository":{"id":177429092,"uuid":"586824794","full_name":"segment-integrations/analytics-swift-localytics","owner":"segment-integrations","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-05T18:26:12.000Z","size":5253,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T01:20:04.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":false,"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/segment-integrations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-01-09T10:16:50.000Z","updated_at":"2024-08-05T18:26:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"bdcb2d7d-0954-40da-af8c-cf95da15679a","html_url":"https://github.com/segment-integrations/analytics-swift-localytics","commit_stats":null,"previous_names":["segment-integrations/analytics-swift-localytics"],"tags_count":1,"template":false,"template_full_name":"segment-integrations/analytics-swift-destination-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-swift-localytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-swift-localytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-swift-localytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-swift-localytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segment-integrations","download_url":"https://codeload.github.com/segment-integrations/analytics-swift-localytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244739944,"owners_count":20501990,"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":[],"created_at":"2024-11-26T12:10:53.325Z","updated_at":"2026-05-14T23:03:55.832Z","avatar_url":"https://github.com/segment-integrations.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Analytics-Swift Localytics\n\nAdd `Localytics` Device Mode support to your applications via this plugin for [Analytics-Swift](https://github.com/segmentio/analytics-swift)\n\n⚠️ **Github Issues disabled in this repository** ⚠️\n\nPlease direct all issues, bug reports, and feature enhancements to `friends@segment.com` so they can be resolved as efficiently as possible. \n\n## Adding the dependency\n\n***Note:*** the `Localytics` library itself will be installed as an additional dependency.\n\n### via Xcode\nIn the Xcode `File` menu, click `Add Packages`.  You'll see a dialog where you can search for Swift packages.  In the search field, enter the URL for this repo:\n\n```\nhttps://github.com/segment-integrations/analytics-swift-localytics\n```\n\nYou'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to.  Once you've made your selections, click the `Add Package` button.  \n\n### via Package.swift\n\nOpen your Package.swift file and add the following do your the `dependencies` section:\n\n```\n.package(\n            name: \"Segment\",\n            url: \"https://github.com/segment-integrations/analytics-swift-localytics.git\",\n            from: \"1.0.0\"\n        ),\n```\n\n\n## Using the Plugin in your App\n\nOpen the file where you setup and configure the Analytics-Swift library.  Add this plugin to the list of imports.\n\n```\nimport Segment\nimport SegmentLocalytics // \u003c-- Add this line\n```\n\nJust under your Analytics-Swift library setup, call `analytics.add(plugin: ...)` to add an instance of the plugin to the Analytics timeline.\n\n```\nlet analytics = Analytics(configuration: Configuration(writeKey: \"\u003cYOUR WRITE KEY\u003e\")\n                    .flushAt(3)\n                    .trackApplicationLifecycleEvents(true))\nanalytics.add(plugin: LocalyticsDestination())\n```\nYour events will now be given Localytics session data and start flowing to Localytics via Device Mode.\n\n\n## Support\n\nPlease use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/).\n\n## Integrating with Segment\n\nInterested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details.\n\n## License\n```\nMIT License\n\nCopyright (c) 2021 Segment\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\nThis template is resolved around `ExampleDestination` (to be replaced by you). \n\n## What does the template provide\n### Data class for holding settings\nTo standardize fetching and using settings in your destination, we recommend using a Coable class to store your destination settings. If marked `Codable`, it will enable you to retrieve your destination settings in a strongly typed construct.\n\n### Settings-related functions\nWe provide APIs to update your destination settings in `update(settings:type:)`.\n`UpdateType.initial` lets you know if this is the intial or subsequent fetch.\n\n`Settings.isDestinationEnabled(key: String)`\n- check if your destination is enabled\n\n`Settings.integrationSettings(forKey: String)`\n- retrieve a typed destination object\n\n### Sample implementation for common destination functions\nWe have templated common destinations functions like `track`, `identify`, `screen`, `group`, `alias` that you should modify to fit your vendor SDK implementation. Although these functions do not need to return the ending payload, its good practice to do so (for unit testing purposes).\n\n### Transforming events\nOften times, destinations need to transform events (eg: change names, modify properties/traits etc.). We have templated an example of transformation in the `track(event:)` example. we recommend you use this approach to perform any such transformations. This will make your code more legible plus improve code quality.\n\n### Testing functions for primary functions (to be expanded)\nWe have provided a very bare minimum template for testing the primary destination APIs. We recommend to use this as a starter and build upon it to get test coverage of most scenarios.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-integrations%2Fanalytics-swift-localytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegment-integrations%2Fanalytics-swift-localytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-integrations%2Fanalytics-swift-localytics/lists"}