Leanplum / Leanplum-Android-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com
Apache License 2.0
46 stars 40 forks source link

Implement wrapper of CleverTap SDK #512

Closed hborisoff closed 1 year ago

hborisoff commented 1 year ago
What Where/Who
JIRA Issue SDK-1824
People Involved @hborisoff

Background

Implements wrapper over CleverTap SDK to duplicate data when migration is enabled.

Migration state and configuration is controlled by the getMigrateState request and also by comparing the hash of the configuration on each multi response to reflect any configuration change on server side. When Duplicate or CleverTapOnly state is received it will create the wrapper instance, this is achievable mid-session or on next start. From Duplicate state you can move back to LeanplumOnly state. When CleverTapOnly state is received it will cause the Leanplum data from VarCache to be cleared and also it wouldn't allow sending data to Leanplum and also reverting back to previous state. Check MigrationManager.handleStateTransition for more details.

New method in Leanplum SDK:

Leanplum.onCleverTapInstanceInitialized(callback) - Some of the CleverTap SDK configuration methods needs to be called on CleverTapAPI instance and this will invoke the callback once instance is created.

Implementation details

Code is implemented in com.leanplum.migration package and separated in several sub packages:

com.leanplum.migration

com.leanplum.migration.model

com.leanplum.migration.wrapper

com.leanplum.migration.push