Emarsys

Emarsys uses AnalyticsEvent.VERSION_2 for its analytics events. To add it to your app you need to:

  1. Include the Emarsys module to your build.gradle.
    implementation ("com.poqstudio:notifications.emarsys:$VERSION_NAME")
  2. Provide the emarsys_configuration.json file in the android raw folder with the following format:
    {
    "applicationCode": String, // Emarsys application code
    "defaultChannelId": String, // Notification channel id
    "defaultChannelName": String, // Notification channel name
    "defaultChannelDesc": String // Notification channel description
    "loggedUserFieldId": Int // Emarsys contact field id
    "predictMerchantId": String? // Optional Emarsys predict merchant id
    }
  3. Inject the singleton EmarsysManager into your application and call init(application: Application, userHash: String?)
  4. Call emarsysManager.login(userHash: String) when the user logins. Your backend should provide you the user hash as sha256(email + salt)
  5. Call emarsysManager.logout() when the user logs out.