{"id":45828919,"url":"https://github.com/parcelvoy/ios-sdk","last_synced_at":"2026-02-26T21:56:49.932Z","repository":{"id":147538081,"uuid":"565343281","full_name":"parcelvoy/ios-sdk","owner":"parcelvoy","description":"Parcelvoy iOS Client SDK","archived":false,"fork":false,"pushed_at":"2026-01-21T18:00:55.000Z","size":91,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-22T05:22:19.983Z","etag":null,"topics":["client","ios","parcelvoy","sdk","swift"],"latest_commit_sha":null,"homepage":"","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/parcelvoy.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-13T04:43:01.000Z","updated_at":"2026-01-21T18:01:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3bb84b1-f1c8-4c38-a6d8-7b0d051fe971","html_url":"https://github.com/parcelvoy/ios-sdk","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/parcelvoy/ios-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelvoy%2Fios-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelvoy%2Fios-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelvoy%2Fios-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelvoy%2Fios-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcelvoy","download_url":"https://codeload.github.com/parcelvoy/ios-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelvoy%2Fios-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29874172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["client","ios","parcelvoy","sdk","swift"],"created_at":"2026-02-26T21:56:49.746Z","updated_at":"2026-02-26T21:56:49.923Z","avatar_url":"https://github.com/parcelvoy.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" alt=\"Parcelvoy Logo\" src=\".github/assets/logo-light.png#gh-light-mode-only\" /\u003e\n  \u003cimg width=\"400\" alt=\"Parcelvoy Logo\" src=\".github/assets/logo-dark.png#gh-dark-mode-only\" /\u003e\n\u003c/p\u003e\n\n# Parcelvoy iOS SDK\n\n## Installation\nInstalling the Parcelvoy iOS SDK will provide you with user identification, deeplink unwrapping and basic tracking functionality. The iOS SDK is available through common package managers (SPM \u0026 Cocoapods) or through manual installation.\n\n### Version Information\n- The Parcelvoy iOS SDK supports\n  - iOS 12.0+\n  - Mac Catalyst 13.0+\n- Xcode 13.2.1 (13C100) or newer\n\n### Swift Package Manager\nGo to File -\u003e Swift Packages -\u003e Add Package Dependency and enter:\n```https://github.com/parcelvoy/ios-sdk```\n\n## Usage\n### Initialize\nBefore using any methods, the library must be initialized with an API key and URL endpoint.\n\nStart by importing the Parcelvoy SDK:\n```swift\nimport Parcelvoy\n```\n\nThen you can initialize the library:\n```swift\nParcelvoy.initialize(apiKey: \"API_KEY\", urlEndpoint: \"URL_ENDPOINT\")\n```\n\n### Identify\nYou can handle the user identity of your users by using the `identify` method. This method works in combination either/or associate a given user to your internal user ID (`external_id`) or to associate attributes (traits) to the user. By default all events and traits are associated with an anonymous ID until a user is identified with an `external_id`. From that point moving forward, all updates to the user and events will be associated to your provider identifier.\n```swift\nParcelvoy.shared.identify(id: \"USER_ID\", traits: [\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\"\n])\n```\n\n### Events\nIf you want to trigger a journey and list updates off of things a user does within your app, you can pass up those events by using the `track` method.\n```swift\nParcelvoy.shared.track(\n    event: \"Event Name\",\n    properties: [\n        \"Key\": \"Value\"\n    ]\n)\n```\n\n### Notifications\n#### Register Device\nIn order to send push notifications to a given device you need to register for notifications and then register the device with Parcelvoy. You can do so by using the `register(token: Data?)` method. If a user does not grant access to send notifications, you can also call this method without a token to register device characteristics.\n```swift\nParcelvoy.shared.register(token: \"APN_TOKEN_DATA\")\n```\n\n#### Handle Notifications\nWhen a notification is received it can contain a deeplink that will trigger when a user opens it. To properly handle the routing you need to pass the received push notification to the Parcelvoy handler.\n```swift\nfunc application(\n    _ application: UIApplication,\n    didReceiveRemoteNotification userInfo: [AnyHashable : Any]\n) async -\u003e UIBackgroundFetchResult {\n    Parcelvoy.shared.handle(application, userInfo: userInfo)\n    return .newData\n}                     \n```\n\n### In-App Notifications\nTo allow for your app to receive custom UI in-app notifications you need to configure your app to properly parse and display them. This is handled by a custom delegate that you set when you initialize the SDK called `InAppDelegate`.\n```swift\n\nclass CustomInAppDelegate: InAppDelegate {\n    func handle(action: InAppAction, context: [String : AnyObject], notification: ParcelvoyNotification) {\n        print(\"PV | Action: \\(action) \\(context)\")\n    }\n}\n\nParcelvoy.initialize(\n    apiKey: apiKey,\n    urlEndpoint: urlEndpoint,\n    inAppDelegate: CustomInAppDelegate(),\n    launchOptions: launchOptions\n)\n```\n\nThis delegate contains three methods that you can configure to help you determine how and when notifications should display.\n```swift\npublic protocol InAppDelegate: AnyObject {\n    var autoShow: Bool { get }\n    func onNew(notification: ParcelvoyNotification) -\u003e InAppDisplayState\n    func handle(action: InAppAction, context: [String: Any], notification: ParcelvoyNotification)\n    func onError(error: Error)\n}\n```\n- `autoShow: boolean`: Should notifications automatically display upon receipt and app open\n- `onNew(notification: ParcelvoyNotification) -\u003e InAppDisplayState`: When a notification is received (and `autoShow` is true), what should the SDK do? Options are:\n    - `show`: Display the notification to the user\n    - `skip`: Iterate to the next notification if there is one, otherwise do nothing. This does not mark the notification as read\n    - `consume`: Mark the notification as read and never show again\n- `handle(action: InAppAction, context: [String: Any], notification: ParcelvoyNotification)`: Triggered when an action is taken inside of a notification. Possible actions are:\n    - `close`: Triggered to dismiss and consume a displayed notification\n    - `custom`: Triggered with custom data for the app to utilize\n- `onError(error: Error)`: Provide errors if any have been encountered\n\nIf you would like to manually handle showing notifications, this can be achieved by turning `autoShow` to false and then calling `Parcelvoy.shared.showLatestNotification()`\n\n#### Helper Methods\n- `getNofications() async throws -\u003e Page\u003cParcelvoyNotification\u003e`: Returns a page of notifications\n- `showLatestNotification() async`: Display the latest notification to the user\n- `show(notification: ParcelvoyNotification) async`: Display a provided notification to the user\n- `consume(notification: ParcelvoyNotification) async`: Mark a notification as being read\n- `dismiss(notification: ParcelvoyNotification) async`: Dismiss a notification if it is being displayed and mark it as being read\n\n#### Handling In-App Actions\nThe SDK handles actions in a couple of different ways. At its simplest, to close a notification you can use the `parcelvoy://dismiss` deeplink.\n\nIf you'd like to pass information from the in-app notification to the app (for example based on what button they click, etc) you can use the JS trigger `window.custom(obj)` or use any other deeplink using the `parcelvoy://` scheme such as `parcelvoy://special/custom`\n\n### Deeplink \u0026 Universal Link Navigation\nTo allow for click tracking links in emails can be click-wrapped in a Parcelvoy url that then needs to be unwrapped for navigation purposes. For information on setting this up on your platform, please see our [deeplink documentation](https://docs.parcelvoy.com/advanced/deeplinking).\n\nParcelvoy includes a method which checks to see if a given URL is a Parcelvoy URL and if so, unwraps the url, triggers the unwrapped URL and calls the Parcelvoy API to register that the URL was executed.\n\nTo start using deeplinking in your app, add your Parcelvoy deployment URL as an Associated Domain to your app. To do so, navigate to Project -\u003e Target -\u003e Select your primary target -\u003e Signing \u0026 Capabilities. From there, scroll down to Associated Domains and hit the plus button. Enter the domain in the format `applinks:YOURDOMAIN.com` i.e. `applinks:parcelvoy.com`.\n\nNext, you'll need to update your apps code to support unwrapping the Parcelvoy URLs that open your app. To do so, use the `handle(universalLink: URL)` method. In your app delegate's `application(_:continue:restorationHandler:)` method, unwrap the URL and pass it to the handler:\n\n```swift\nfunc application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -\u003e Void) -\u003e Bool {\n\n    guard let url = userActivity.webpageURL else {\n        return false\n    }\n\n    return Parcelvoy.shared.handle(universalLink: url)\n}\n```\n\nParcelvoy links will now be automatically read and opened in your application.\n\n## Example\n\nExplore our [example project](/Example) which includes basic usage.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcelvoy%2Fios-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcelvoy%2Fios-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcelvoy%2Fios-sdk/lists"}