{"id":31952851,"url":"https://github.com/batchlabs/batch-ios-sdk-sample","last_synced_at":"2025-10-14T13:25:22.413Z","repository":{"id":44520792,"uuid":"512799620","full_name":"BatchLabs/Batch-iOS-SDK-Sample","owner":"BatchLabs","description":"Sample app for Batch's iOS SDK","archived":false,"fork":false,"pushed_at":"2025-06-30T09:47:54.000Z","size":5145,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-29T23:55:35.498Z","etag":null,"topics":[],"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/BatchLabs.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}},"created_at":"2022-07-11T14:54:46.000Z","updated_at":"2025-06-30T09:47:58.000Z","dependencies_parsed_at":"2025-01-03T20:15:54.662Z","dependency_job_id":null,"html_url":"https://github.com/BatchLabs/Batch-iOS-SDK-Sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BatchLabs/Batch-iOS-SDK-Sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-iOS-SDK-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-iOS-SDK-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-iOS-SDK-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-iOS-SDK-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BatchLabs","download_url":"https://codeload.github.com/BatchLabs/Batch-iOS-SDK-Sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-iOS-SDK-Sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018708,"owners_count":26086606,"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-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2025-10-14T13:24:53.215Z","updated_at":"2025-10-14T13:25:22.409Z","avatar_url":"https://github.com/BatchLabs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://static.batch.com/documentation/Readmes/logo_batch_full_178.png)\n\n# Batch store\nThis sample is a full fledged example meant to show both basic and advanced integrations of the Batch SDK with a real-world use case.  \n\n# How run it\n* Clone this repository\n* Follow this instructions about prerequisites [https://doc.batch.com/ios/prerequisites](https://doc.batch.com/ios/prerequisites). You will need to associate the project to a Firebase Project to continue.\n* Batch SDK is already installed, you have to setup Batch with your API KEY in `AppDelegate.swift`: search for `let BatchAPIKey`\n* Run your app. You should see the following log :\n\n```\n[Batch] Installation ID: \u003cyour installation ID\u003e\n```\nMore informations : [https://doc.batch.com/ios/sdk-integration/initial-setup](https://doc.batch.com/ios/sdk-integration/initial-setup)\n\n# In-app Messaging\n\nYou can setup your first In-app campaign.\n\n### How sample work\nIn-app campaigns will appear on your users’ screen according to a specific trigger.\nFor example, you can choose to display an In-app promoting a discount when a user add one article to cart.\n\nSample app contains 3 triggers \n```swift\n// Track when the user selects an article\nclass func trackArticleVisit(_ article: Article) {\n    BatchProfile.trackEvent(name: \"ARTICLE_VIEW\", attributes: BatchEventAttributes { attrs in\n        attrs.put(article.name, forKey: \"$label\")\n        attrs.put(article.name, forKey: \"article\")\n    })\n}\n\n// Track when the user add article to cart\nclass func trackAddArticleToCart(_ article: Article) {\n    BatchProfile.trackEvent(name: \"ADD_TO_CART\", attributes: BatchEventAttributes { attrs in\n        attrs.put(article.name, forKey: \"$label\")\n        attrs.put(article.name, forKey: \"article\")\n    })\n}\n\n// Track when the user proceed to checkout\nclass func trackCheckout(_ amount: Double) {\n    BatchProfile.trackEvent(name: \"CHECKOUT\")\n}\n```\nThis triggers can be use in the Batch dashboard with labels. \nMore details here : https://doc.batch.com/dashboard/in-app-messaging/campaign-edition.html#_trigger-condition\n\n**Example :**\n- Create campaign\n- Set trigger **display event** : `add_to_cart`\n- Set **label** : `Patek Philippe` (If you don’t select any labels, Batch will trigger the message on every trigger of the selected event)\n![Example](_doc/dashboard_trigger.jpg)\n- Setup message edition on the interface\n\nIn app, if you select Patek Philippe in your cart, you will see In App messaging.\n\n\n## Resources\n* [Full Batch documentation](https://doc.batch.com)\n* [support@batch.com](support@batch.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-ios-sdk-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbatchlabs%2Fbatch-ios-sdk-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-ios-sdk-sample/lists"}