-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement wrapper of CleverTap SDK #518
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…-migration # Conflicts: # LeanplumSDK/LeanplumSDK.xcodeproj/project.pbxproj # LeanplumSDKApp/LeanplumSDKApp.xcodeproj/project.pbxproj # LeanplumSDKLocation/LeanplumSDKLocation.xcodeproj/project.pbxproj # Package.swift
hborisoff
approved these changes
Oct 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
CleverTap Wrapper implementation to support migration to CleverTap.
Migration is started through the API by the
getMigrateState
API call. This request returns the information needed so that theMigrationManager
andCTWrapper
can duplicate data through CleverTap SDK.Example of response for getMigrateState:
Example of configuration hash code in multi response:
Based on the Migration State (the
sdk
parameter), the Leanplum SDK can work in 4 modes:undefined
- nogetMigrateState
request is done yet, state is unknown, Leanplum operates as is.leanplum
- Leanplum only, Leanplum operates as is.duplicate
- CleverTap is initialized and now data is recorded in both Leanplum and CleverTap. Campaigns are also served through CleverTap SDK.cleverTap
- only CleverTap SDK is used. Data is not sent to Leanplum.CleverTap instance in Leanplum SDK:
+ (void)onCleverTapInstanceInitialized:(LeanplumCleverTapInstanceBlock)block;
- once the CleverTap instance is created, this block will be called. Use the instance to call CleverTap methods and configurations.This method will not be available in Swift if you do not have the CleverTap SDK as a dependency.
Implementation
Implementation is in
swift
under the Migration group.MigrationManager
- Exposes all methods (MigrationManager+API
) that the rest of the Leanplum SDK would use to send and receive data for migration purposes. Holds the instance of theWrapper
, as well as, the CleverTap account details and attribute mappings.MigrationManager+ResponseHandler
- Handles the response of thegetMigrateState
API and themulti
response parameter.MigrationState
- enum that holds the state options. UsesInt
to be Objective-C compatible and can be initialized from the string returned by the API and has thedescription
implemented.CTWrapper
- maps all methods and parameters to the CleverTap ones. Initializes the CleverTap Config and instance. The transformation logic for keys and values is in theCTWrapper+Utilities
.IdentityManager
- logic to handleIdentity
andCTID
based on the LeanplumuserId
anddeviceId
. Manages the login process andanonymous
/identified
users process.Testing steps
Unit tests for the
CTWrapper
andIdentityManager
.Is this change backwards-compatible?