{"id":31952862,"url":"https://github.com/batchlabs/batch-android-sdk-sample","last_synced_at":"2025-10-14T13:25:25.696Z","repository":{"id":91317585,"uuid":"150422123","full_name":"BatchLabs/Batch-Android-SDK-Sample","owner":"BatchLabs","description":"Sample app for Batch's Android SDK","archived":false,"fork":false,"pushed_at":"2025-06-09T12:00:57.000Z","size":1882,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-29T23:55:35.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/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":"2018-09-26T12:20:29.000Z","updated_at":"2025-06-09T12:01:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"eedf8ef8-f5c1-4948-a6e2-1e8b16765133","html_url":"https://github.com/BatchLabs/Batch-Android-SDK-Sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BatchLabs/Batch-Android-SDK-Sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Android-SDK-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Android-SDK-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Android-SDK-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Android-SDK-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BatchLabs","download_url":"https://codeload.github.com/BatchLabs/Batch-Android-SDK-Sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BatchLabs%2FBatch-Android-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:55.095Z","updated_at":"2025-10-14T13:25:25.687Z","avatar_url":"https://github.com/BatchLabs.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://raw.github.com/BatchLabs/batchcast-ios/master/readme_logo.png)\n\n# Batch store\nSample mCommerce (Batch Store) for sales.\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://batch.com/doc/android/prerequisites](https://batch.com/doc/android/prerequisites.html). 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 build.gradle : `buildConfigField \"String\", \"API_KEY\", '\"\u003cYOUR API KEY HERE\u003e\"'` Make sure you keep `'\"` before your API Key and `\"'` after, they are needed to make a working string constant.\n* Build gradle\n* Run your app, open the Logcat tab of Android Studio. You should see the following logs :\n\n```\nBatch (\u003cversion\u003e) is running in dev mode (your API key is a dev one)\nInstallation ID: \u003cyour installation ID\u003e\n```\nMore information : [https://batch.com/doc/android/sdk-integration](https://batch.com/doc/android/sdk-integration.html#_your-first-start)\n\n# In App Messaging\n\nWell, installation's over you 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```kotlin\n// Track when the user select an article\nfun trackArticleVisit(article: Article){\n    Batch.Profile.trackEvent(\"ARTICLE_VIEW\", BatchEventAttributes().apply {\n        put(BatchEventAttributes.LABEL_KEY, article.name)\n        put(\"name\", article.name)\n    })\n}\n// Track when the user add article to cart\nfun trackAddArticleToCart(article: Article){\n    Batch.Profile.trackEvent(\"ADD_TO_CART\", BatchEventAttributes().apply {\n        put(BatchEventAttributes.LABEL_KEY, article.name)\n        put(\"name\", article.name)\n    })\n}\n\n// Track when the user proceed to checkout\nfun trackCheckout(amount: Double){\n    Batch.Profile.trackEvent(\"CHECKOUT\", BatchEventAttributes().apply {\n        put(\"amount\", amount)\n    })\n}\n```\nThis triggers can be use in the Batch dashboard with labels. \nMore details here : https://batch.com/doc/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](example_trigger.png)\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://dashboard.batch.com/doc)\n* [support@batch.com](support@batch.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-android-sdk-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbatchlabs%2Fbatch-android-sdk-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbatchlabs%2Fbatch-android-sdk-sample/lists"}