{"id":15040932,"url":"https://github.com/emartech/android-emarsys-sdk","last_synced_at":"2025-08-16T21:14:52.081Z","repository":{"id":41657861,"uuid":"142430751","full_name":"emartech/android-emarsys-sdk","owner":"emartech","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-04T13:48:38.000Z","size":6849,"stargazers_count":21,"open_issues_count":6,"forks_count":19,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-04T16:52:50.213Z","etag":null,"topics":["android","emarsys-sdk","mobilesdk"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emartech.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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}},"created_at":"2018-07-26T11:17:31.000Z","updated_at":"2025-08-04T13:47:44.000Z","dependencies_parsed_at":"2024-04-22T12:50:49.858Z","dependency_job_id":"abf1db98-07d2-418b-861a-58325f6472d9","html_url":"https://github.com/emartech/android-emarsys-sdk","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/emartech/android-emarsys-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fandroid-emarsys-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fandroid-emarsys-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fandroid-emarsys-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fandroid-emarsys-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emartech","download_url":"https://codeload.github.com/emartech/android-emarsys-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fandroid-emarsys-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270771927,"owners_count":24642386,"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-08-16T02:00:11.002Z","response_time":91,"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":["android","emarsys-sdk","mobilesdk"],"created_at":"2024-09-24T20:45:17.959Z","updated_at":"2025-08-16T21:14:52.031Z","avatar_url":"https://github.com/emartech.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build](https://github.com/emartech/android-emarsys-sdk/workflows/Last%20push%20build/badge.svg)\n[![REUSE status](https://api.reuse.software/badge/github.com/emartech/android-emarsys-sdk)](https://api.reuse.software/info/github.com/emartech/android-emarsys-sdk)\n\n## Contents\n\n- [What is the Emarsys SDK?](#what-is-the-emarsys-sdk \"Emarsys SDK\")\n- [1. Setup](#1-setup)\n    - [1.1 Sample App](#11-sample-app \"Sample App\")\n    - [1.2 Installation with Gradle](#12-installation-with-gradle \"Gradle\")\n    - [1.3 Add Gradle dependency](#13-add-gradle-dependency \"Add as dependency\")\n- [2. Requirements](#2-requirements \"Requirements\")\n    - [2.1 Using AndroidX](#21-using-androidx \"AndroidX\")\n    - [2.2 Push Notifications](#22-push-notifications \"Push Notifications\")\n        - [2.2.1 Firebase](#221-firebase \"Firebase\")\n        - [2.2.2 Huawei](#222-huawei \"Huawei\")\n- [Documentation](https://github.com/emartech/android-emarsys-sdk/wiki \"Documentation\")\n- [Migrate from Mobile Engage SDK](https://github.com/emartech/android-emarsys-sdk/wiki/Migrate-from-Mobile-Engage \"Migration Guide\")\n- [Mobile Engage Glossary](https://github.com/emartech/android-emarsys-sdk/wiki/Glossary \"Glossary\")\n- [Obtaining Firebase Cloud Messaging credentials](https://github.com/emartech/android-emarsys-sdk/wiki/Obtaining-Firebase-Cloud-Messaging-credentials \"Firebase credentials\")\n- [Android Oreo Channels](https://github.com/emartech/android-emarsys-sdk/wiki/Android-Oreo-Channels \"Oreo Channels\")\n- [Rich Push Notifications](https://github.com/emartech/android-emarsys-sdk/wiki/Rich-Push-Notifications \"Rich Push Notifications\")\n- [DeepLink](https://github.com/emartech/android-emarsys-sdk/wiki/DeepLink \"DeepLink\")\n- [FAQ](https://github.com/emartech/android-emarsys-sdk/wiki/FAQ \"FAQ\")\n\n\n# What is the Emarsys SDK?\n\nThe Emarsys SDK enables you to use Mobile Engage and Predict in a very straightforward way. By incorporating the SDK in your\napp, we, among other things, support you in handling credentials, API calls, tracking of opens and events as well as logins and\nlogouts in the app.\nThe Emarsys SDK is open-sourced to enhance transparency and to remove privacy concerns. This also means that you will always\nbe up-to-date with what we are working on.\n\nUsing the SDK is also beneficial from the product aspect: it simply makes it much easier to send push messages through your app. Please always use the latest version of the SDK in your app.\n\n## 1. Setup\n\n### 1.1 Sample app\n\nWe created a sample application to help in the integration and give an example. Find instructions for the build process [here](https://github.com/emartech/android-emarsys-sdk/blob/master/sample).\n\n\n### 1.2 Installation with Gradle\n\nGradle is a build system for Android, which automates and simplifies the process of using 3rd-party libraries.\n\n\n### 1.3 Add Gradle dependency\n\nTo integrate EmarsysSDK into your Android project using Gradle, specify it in your application's build.gradle file:\n\n```groovy\ndependencies {\n\timplementation 'com.emarsys:emarsys-sdk:‹latest_released_version_of_emarsys-sdk›'\n}\n```\n\n## 2. Requirements\n\n* The minimum Android version should be at least API level 24.\n* Requires compileSdkVersion 31 or higher.\n* Emarsys SDK is using AndroidX.\n\n### 2.1 Using AndroidX\nSee [Migrating to AndroidX](https://developer.android.com/jetpack/androidx/migrate \"AndroidX Migration Documentation\") to learn how to migrate an existing project.\n\nIf you want to use Emarsys SDK in a new project, you need to set the compile SDK to Android 9.0 (API level 28) or higher and set both of the following Android Gradle plugin flags to true in your gradle.properties file.\n\nandroid.useAndroidX: When set to true, the Android plugin uses the appropriate AndroidX library instead of a Support Library. The flag is false by default if it is not specified.\n\nandroid.enableJetifier: When set to true, the Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries. The flag is false by default if it is not specified.\n\n### 2.2 Push Notifications\n\nStarting from Android 13 (API level 33) the `POST_NOTIFICATIONS` runtime permission is required. In order to receive push notifications this permission must be granted by the user. [Android Dev](https://developer.android.com/about/versions/13/changes/notification-permission)\n\nEmarsys SDK supports multiple push providers([Firebase](https://firebase.google.com/docs/cloud-messaging), [Huawei](https://developer.huawei.com/consumer/en/hms/huawei-pushkit/)). Integrating both, or one of them is necessary for using the Mobile Engage Push feature.\n\nIf you want to support both providers, you can include both of them in your application.\n\nYou can set a custom notification icon, by specifying it as a meta-data between your application tag:\n\n```xml\n\u003cmeta-data\nandroid:name=\"com.emarsys.mobileengage.small_notification_icon\"\nandroid:resource=\"@drawable/notification_icon\" /\u003e\n```\n\n### 2.2.1 Firebase\n\nWhen the pushToken arrives we need to set it using `Emarsys.Push.setPushToken()`. For more information about how to obtain your\nFCM token please consult the Firebase integration guides:\n\n* [Firebase core integration](https://firebase.google.com/docs/android/setup \"Firebase Integration Guide\")\n* [Firebase messaging](https://firebase.google.com/docs/cloud-messaging/android/client \"FCM Documentation\")\n\n\nThe recommended way of using the SDK is to enable the Emarsys SDK to automatically handle `setPushToken` and `trackMessageOpen` calls for you, please register this service in your manifest:\n\n```xml\n\u003cservice android:name=\"com.emarsys.service.EmarsysFirebaseMessagingService\"\n         android:exported=\"false\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\"/\u003e\n    \u003c/intent-filter\u003e\n\u003c/service\u003e\n```\n\nIf it is needed, you can add your custom implementation to handle `setPushToken` and `trackMessageOpen`.\n\n###### Java\n```java\npublic class MyMessagingService extends FirebaseMessagingService {\n\n    @Override\n    public void onNewToken(String token) {\n        super.onNewToken(token);\n\n        Emarsys.Push.setPushToken(token);\n    }\n\n    @Override\n    public void onMessageReceived(RemoteMessage remoteMessage) {\n    super.onMessageReceived(remoteMessage);\n\n        boolean handledByEmarsysSDK = EmarsysFirebaseMessagingServiceUtils.handleMessage(this, remoteMessage);\n\n        if (!handledByEmarsysSDK) {\n            //handle your custom push message here\n            ...\n        }\n    }\n}\n```\n\n###### Kotlin\n```kotlin\nclass MyMessagingService : FirebaseMessagingService() {\n\n    override fun onNewToken(token: String?) {\n        super.onNewToken(token)\n        Emarsys.Push.setPushToken(token!!)\n    }\n\n    override fun onMessageReceived(remoteMessage: RemoteMessage?) {\n        super.onMessageReceived(remoteMessage)\n        val handledByEmarsysSDK =\n        EmarsysFirebaseMessagingServiceUtils.handleMessage(this, remoteMessage)\n        if (!handledByEmarsysSDK) {\n            //handle your custom push message here\n            ...\n        }\n    }\n}\n```\n\n#### 2.2.2 Huawei\n\u003e __Important Note__: Push sending for [Huawei is unavailable](https://developer.huawei.com/consumer/en/doc/HMSCore-Guides/emui-version-dependent-0000001050042515) for devices below API level 22!\n\u003e\n\u003e __Huawei Push Messaging__ is only available from Emarsys SDK 3.0.0!\n\u003e \n\u003e Emarsys SDK checks if the device has Google Play Services available and if not, it is considered as a `Huawei` device. Please note that as Google Play Services is not availeble with Huawei only integrations, [Geofencing](https://github.com/emartech/android-emarsys-sdk/wiki#8-geofence) will not work!\n\nWhen the pushToken arrives we need to set it using `Emarsys.Push.setPushToken()`. For more information about how to obtain your\nHMS token please consult the Huawei integration guides:\n\n* [Huawei Push Kit integration](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050040060 \"Huawei Push Kit Integration Guide\")\n\nThe recommended way of using the SDK is to enable the Emarsys SDK to automatically handle `setPushToken` and `trackMessageOpen` calls for you, please register this service in your manifest:\n\n```xml\n\n\u003cmeta-data\n    android:name=\"com.huawei.hms.client.channel.androidMarket\"\n    android:value=\"false\" /\u003e\n\u003cmeta-data\nandroid:name=\"push_kit_auto_init_enabled\"\nandroid:value=\"true\" /\u003e\n\u003cservice\n    android:name=\"com.emarsys.service.EmarsysHuaweiMessagingService\"\n    android:exported=\"false\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"com.huawei.push.action.MESSAGING_EVENT\"/\u003e\n    \u003c/intent-filter\u003e\n\u003c/service\u003e\n```\n\nIf it is needed, you can add your custom implementation to handle `setPushToken` and `trackMessageOpen`.\n\n###### Java\n```java\npublic class MyMessagingService extends HmsMessageService {\n\n    @Override\n    public void onNewToken(String token) {\n        super.onNewToken(token);\n\n        Emarsys.Push.setPushToken(token);\n    }\n\n    @Override\n    public void onMessageReceived(RemoteMessage remoteMessage) {\n    super.onMessageReceived(remoteMessage);\n\n        boolean handledByEmarsysSDK = EmarsysHuaweiMessagingServiceUtils.handleMessage(this, remoteMessage);\n\n        if (!handledByEmarsysSDK) {\n            //handle your custom push message here\n            ...\n        }\n    }\n}\n```\n###### Kotlin\n```kotlin\nclass MyMessagingService : HmsMessageService() {\n\n    override fun onNewToken(token: String?) {\n        super.onNewToken(token)\n        Emarsys.Push.setPushToken(token!!)\n    }\n\n    override fun onMessageReceived(remoteMessage: RemoteMessage?) {\n        super.onMessageReceived(remoteMessage)\n        val handledByEmarsysSDK =\n        EmarsysHuaweiMessagingServiceUtils.handleMessage(this, remoteMessage)\n        if (!handledByEmarsysSDK) {\n            //handle your custom push message here\n            ...\n        }\n    }\n}\n```\n\n\u003e For further informations about how to use our SDK please visit our [Documentation](https://github.com/emartech/android-emarsys-sdk/wiki)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fandroid-emarsys-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femartech%2Fandroid-emarsys-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fandroid-emarsys-sdk/lists"}