{"id":21762105,"url":"https://github.com/segment-integrations/analytics-kotlin-engage","last_synced_at":"2026-04-10T21:02:22.672Z","repository":{"id":182682047,"uuid":"665247432","full_name":"segment-integrations/analytics-kotlin-engage","owner":"segment-integrations","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-28T21:06:23.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T23:44:09.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segment-integrations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"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":"2023-07-11T19:17:45.000Z","updated_at":"2023-07-20T21:37:29.000Z","dependencies_parsed_at":"2024-11-26T12:11:08.495Z","dependency_job_id":"c09807f1-2e84-4b73-ad4a-2197da71e8f1","html_url":"https://github.com/segment-integrations/analytics-kotlin-engage","commit_stats":null,"previous_names":["segment-integrations/analytics-kotlin-engage"],"tags_count":4,"template":false,"template_full_name":"segment-integrations/analytics-kotlin-destination-template","purl":"pkg:github/segment-integrations/analytics-kotlin-engage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-kotlin-engage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-kotlin-engage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-kotlin-engage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-kotlin-engage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segment-integrations","download_url":"https://codeload.github.com/segment-integrations/analytics-kotlin-engage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-integrations%2Fanalytics-kotlin-engage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31658964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: 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":[],"created_at":"2024-11-26T12:10:57.996Z","updated_at":"2026-04-10T21:02:22.644Z","avatar_url":"https://github.com/segment-integrations.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Twilio Engage Destination\n\n- [Twilio Engage Destination](#twilio-engage-destination)\n  - [Getting Started](#getting-started)\n  - [Subscription](#subscription)\n  - [Customizations](#customizations)\n  - [Predefined Actions](#predefined-actions)\n  - [Customized Actions](#customized-actions)\n    - [Customized TapAction](#customized-tapaction)\n    - [Customized TapActionButtons](#customized-tapactionbuttons)\n  - [License](#license)\n\nThis plugin enables Segment's Analytics SDK to do push notification management with Twilio Engage.\n\n## Getting Started\n\nTo get started:\n1. follow the instruction of Analytics Kotlin [here](https://segment.com/docs/connections/sources/catalog/libraries/mobile/kotlin-android/#getting-started) \nto integrate Segment's Analytics SDK to your app. \n2. add the following to your gradle dependencies:\n\n```groovy\n    implementation 'com.segment.analytics.kotlin.destinations:engage:\u003cLATEST_VERSION\u003e'\n```\n\n3. add the following service to your AndroidManifest.xml `application` tag\n\n```xml\n    \u003cservice\n        android:name=\"com.segment.analytics.kotlin.destinations.engage.EngageFirebaseMessagingService\"\n        android:exported=\"true\"\u003e\n        \u003cintent-filter\u003e\n          \u003caction android:name=\"com.google.firebase.INSTANCE_ID_EVENT\"/\u003e\n          \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\" /\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n```\n\n4. add this plugin to your Analytics instance:\n```kotlin\n    analytics.add(TwilioEngage(applicationContext))\n```\n\n## Subscription\n\nOnce the plugin is setup, it automatically tracks and updates push notification subscriptions \naccording to device's notification permissions. To listen to the subscription status changes, \nprovide a `StatusCallback` when initialize the plugin as following:\n```kotlin\n    TwilioEngage(applicationContext, statusCallback = { previous, current -\u003e  \n        // handle status changes            \n    })\n```\n\nOn Android, three different status are tracked: `Subscribed`, `DidNotSubscribe`, `Unsubscribed`. \n* `Subscribed` is reported whenever app user toggles their device settings to allow push notification\n* `DidNotSubscribe` is reported in fresh start where no status has ever been reported\n* `Unsubscribed` is reported whenever user toggles their device settings to disable push notification and when the SDK fails to obtain a token from FCM\n\n## Customizations\n\nTo customize the push notification, provide a `NotificationCustomizationCallback` when initialize \nthe plugin as following:\n```kotlin\n    TwilioEngage(applicationContext, notificationCustomizationCallback = { builder, customization -\u003e\n        // customize your notification here\n    })\n```\n\nIn the callback:\n* `builder` gives you the full control of build the notification\n* `customization` provides you dynamic customization data from the Engage Console\n\nFollowing is a list of options that `customization` provides:\n|Option Name|Description|\n|---|---|\n|title|The title of the notification|\n|body|The body of the notification|\n|media|Media urls to send with the notification.|\n|badgeAmount|The badge count which is used in combination with badge strategy to determine the final badge.|\n|badgeStrategy|Sets the badge count strategy in the notification.|\n|sound|Sound to be played|\n|priority|High priority uses ring tones and vibrations, low does not|\n|ttl|When 0, notification is tried once. Otherwise, its tried until success or ttl (time to live) expires|\n|link|A link to route to (deep or url) when the notification is tapped|\n|tapAction|action to perform when the notification is tapped|\n|tapActionButtons|buttons that shows on notification|\n\nThe plugin provides a default implementation for all of the above options, for example, badge counts, \npriority, sounds, etc. But you can make further customization by using the callback.\n\n## Predefined Actions\n\nThere are 3 predefined actions that the plugin handles by default. When the value of `tapAction`  \nor `tapActionButtons.onTap` is:\n* `open_app`: the app opens to the main view when the notification/button is on tapped.\n* `open_url`: the default browser opens a webview to the provided `link`\n* `deep_link`: the application routes to the provided `link`\n\n## Customized Actions\n\n`tapAction` and `tapActionButtons.onTap` can also be customized using the `NotificationCustomizationCallback`\n\n### Customized TapAction\n\nCustomize `tapAction` changes the behavior when user taps the notification. Note that if you have\ncustom action that is not one of the Predefined Actions, you must handle that action using the following\ncode below, or tapping on the notification will not have any effect.\n\n```kotlin\n    TwilioEngage(applicationContext, notificationCustomizationCallback = { builder, customization -\u003e\n        // setup your custom intent and pending intent\n        val intent = Intent(Intent.ACTION_VIEW).apply {\n            data = Uri.parse(\"https://www.github.com\")\n        }\n        val pi = PendingIntent.getActivity(applicationContext, 101, intent, PendingIntent.FLAG_UPDATE_CURRENT)\n    \n        // overwrite the default intent\n        builder.setContentIntent(pi)\n        builder.setDeleteIntent(pi)\n    })\n```\n\n### Customized TapActionButtons\n\nThere are two situations that a `tapActionButton` is not rendered:\n* too many `tapActionButtons` are provided. The maximum of `tapActionButtons` supported by Twilio Engage is `3`. \n* custom action that is not one of the Predefined Actions is not handled in `NotificationCustomizationCallback`.\n\nThus, make sure you are not passing more than 3 buttons in the payload and manually handle custom\naction using the code below if it is not a Predefined Action.\n\n```kotlin\n    TwilioEngage(applicationContext, notificationCustomizationCallback = { builder, customization -\u003e\n        // go through every custom tapActionButtons\n        customization.tapActionButtons?.forEach { button -\u003e\n            // create an intent for this button\n            val intent = Intent(Intent.ACTION_VIEW).apply {\n                data = Uri.parse(button.link)\n            }\n            // add the button to notification\n            builder.addAction(0, button.text, PendingIntent.getActivity(applicationContext, 101, intent, PendingIntent.FLAG_UPDATE_CURRENT))\n        }\n    })\n```\n\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-integrations%2Fanalytics-kotlin-engage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegment-integrations%2Fanalytics-kotlin-engage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-integrations%2Fanalytics-kotlin-engage/lists"}