Marigold Rebrand Migration Guide
How to migrate to the rebranded SDKs
This documentation will walk you through the process of updating your SDK versions to the rebranded 'Marigold' SDK. This mostly involves updating all references of 'SailthruMobile' into 'Marigold', however there are some finer points that you need to be aware of. This guide is here to help you smoothly transition to the updated 'Marigold' framework.
iOS
Framework updates
The frameworks have been renamed from SailthruMobile.framework
to Marigold.framework
and SailthruMobileExtension.framework
to MarigoldExtension.framework
.
Cocoapods
If you are using Cocoapods you will need to update to the new Pods:
# Previously
pod 'SailthruMobile'
pod 'SailthruMobile/Extension'
# Now
pod 'Marigold'
pod 'Marigold/Extension'
Carthage
If you are using Carthage the Github location will remain the same but you will need to change the linked frameworks to Marigold.framework
and MarigoldExtension.framework
instead of the old 'SailthruMobile' versions.
SailthruMobile to Marigold
The main class has been renamed from SailthruMobile to Marigold. So for instance when calling startEngine
:
// Previously
[[SailthruMobile new] startEngine:@"Your_app_key"];
// Now
[[Marigold new] startEngine:@"Your_app_key"];
// Previously
SailthruMobile().startEngine("Your_app_key")
// Now
Marigold().startEngine("Your_app_key")
STM -> MAR
All other classes have been renamed but will otherwise function in the same way as before:
Before | After |
---|---|
SailthruMobile | Marigold |
STMAttributes | MARAttributes |
STMContentItem | MARContentItem |
STMLogger | MARLogger |
STMMessage | MARMessage |
STMMessageStream | MARMessageStream |
STMNotificationCategory | MARNotificationCategory |
STMPurchase | MARPurchase |
STMPurchaseItem | MARPurchaseItem |
Examples:
// Previously
STMAttributes *attributes = [[STMAttributes alloc] init];
STMPurchaseItem *item = [[STMPurchaseItem alloc] initWithQuantity:2 title:@"Made Up Object" price:1234 itemId:@"2345" itemUrl:itemUrl];
STMPurchase *purchase = [[STMPurchase alloc] initWithPurchaseItems:@[ item ]];
// Now
MARAttributes *attributes = [[MARAttributes alloc] init];
MARPurchaseItem *item = [[MARPurchaseItem alloc] initWithQuantity:2 title:@"Made Up Object" price:1234 itemId:@"2345" itemUrl:itemUrl];
MARPurchase *purchase = [[MARPurchase alloc] initWithPurchaseItems:@[ item ]];
// Previously
let attributes = CarnivalAttributes()
let item = CarnivalPurchaseItem(quantity: 2, title: "Made Up Object", price: 1234, itemId: "2345", itemUrl: url!)
// create purchase
let purchase = CarnivalPurchase(purchaseItems: [ item ])
// Now
let attributes = STMAttributes()
let item = STMPurchaseItem(quantity: 2, title: "Made Up Object", price: 1234, itemId: "2345", itemUrl: url!)
// create purchase
let purchase = STMPurchase(purchaseItems: [ item ])
Extension SDK
The Extension SDK has followed the same rebranding pattern, the main class has changed from SailthruMobileExtension
to MarigoldExtension
. The other classes have changed to the 'MAR' prefix.
// Previously
SailthruMobileExtension *extension = [[SailthruMobileExtension alloc] initWithAppKey:@"Your_app_key" groupName:@"your.group.name"];
// Now
MarigoldExtension *extension = [[MarigoldExtension alloc] initWithAppKey:@"Your_app_key" groupName:@"your.group.name"];
// Previously
let extension = SailthruMobileExtension(appKey: "Your_app_key", groupName: "your.group.name")
// Now
let extension = MarigoldExtension(appKey: "Your_app_key", groupName: "your.group.name")
Android
Package Change
The Android SDK has been repackaged from com.sailthru.mobile.sdk
to com.marigold.sdk
. In your build.gradle
file it will look like this:
// Previously
implementation 'com.sailthru.mobile.sdk:sailthru-mobile:10.1.0'
// Now
implementation 'com.marigold.sdk:marigold:10.1.0'
The Maven url will remain the same. Some of the classes have also been separated out into sub-packages. Below are the mappings for the package changes per class.
Enums:
Before | After |
---|---|
com.sailthru.mobile.sdk.enums.EventSource | com.marigold.sdk.enums.EventSource |
com.sailthru.mobile.sdk.enums.ImpressionType | com.marigold.sdk.enums.ImpressionType |
com.sailthru.mobile.sdk.enums.NotificationActionState | com.marigold.sdk.enums.NotificationActionState |
com.sailthru.mobile.sdk.enums.NotificationPermissionRequestResult | com.marigold.sdk.enums.NotificationPermissionRequestResult |
Interfaces:
Before | After |
---|---|
com.sailthru.mobile.sdk.interfaces.ContentIntentBuilder | com.marigold.sdk.interfaces.ContentIntentBuilder |
com.sailthru.mobile.sdk.interfaces.Logger | com.marigold.sdk.interfaces.Logger |
com.sailthru.mobile.sdk.interfaces.NotificationActionTappedListener | com.marigold.sdk.interfaces.NotificationActionTappedListener |
com.sailthru.mobile.sdk.interfaces.NotificationReceivedListener | com.marigold.sdk.interfaces.NotificationReceivedListener |
com.sailthru.mobile.sdk.interfaces.NotificationSilencer | com.marigold.sdk.interfaces.NotificationSilencer |
com.sailthru.mobile.sdk.interfaces.NotificationTappedListener | com.marigold.sdk.interfaces.NotificationTappedListener |
Model:
Before | After |
---|---|
com.sailthru.mobile.sdk.model.ActionTapped | com.marigold.sdk.model.ActionTapped |
com.sailthru.mobile.sdk.model.AttributeMap | com.marigold.sdk.model.AttributeMap |
com.sailthru.mobile.sdk.model.Message | com.marigold.sdk.model.Message |
com.sailthru.mobile.sdk.model.Purchase | com.marigold.sdk.model.Purchase |
com.sailthru.mobile.sdk.model.PurchaseAdjustment | com.marigold.sdk.model.PurchaseAdjustment |
com.sailthru.mobile.sdk.model.PurchaseItem | com.marigold.sdk.model.PurchaseItem |
Main:
Before | After |
---|---|
(new class) | com.marigold.sdk.EngageBySailthru |
(new class) | com.marigold.sdk.EngageBySailthruExtensions |
com.sailthru.mobile.sdk.HttpError | com.marigold.sdk.HttpError |
com.sailthru.mobile.sdk.SailthruMobile | com.marigold.sdk.Marigold |
com.sailthru.mobile.sdk.SailthruMobileExtensions | com.marigold.sdk.MarigoldExtensions |
com.sailthru.mobile.sdk.MessageActivity | com.marigold.sdk.MessageActivity |
com.sailthru.mobile.sdk.MessageStream | com.marigold.sdk.MessageStream |
com.sailthru.mobile.sdk.MessageStreamExtensions | com.marigold.sdk.MessageStreamExtensions |
com.sailthru.mobile.sdk.NotificationBundle | com.marigold.sdk.NotificationBundle |
com.sailthru.mobile.sdk.NotificationCategory | com.marigold.sdk.NotificationCategory |
com.sailthru.mobile.sdk.NotificationConfig | com.marigold.sdk.NotificationConfig |
com.sailthru.mobile.sdk.NotificationExtender | com.marigold.sdk.NotificationExtender |
SailthruMobile to Marigold
The main class in the Android SDK has been renamed from SailthruMobile
to Marigold
. It has also been converted to using instance methods rather than static methods:
// Previously
new SailthruMobile().startEngine("Your_app_key");
// Now
new Marigold().startEngine("Your_app_key");
// Previously
SailthruMobile().startEngine("Your_app_key")
// Now
Marigold().startEngine("Your_app_key")
Any resources named 'st_*' have now had 'st_*' prefix removed.
React Native
The React Native rebrand is currently in progress - this guide will be updated once the work is complete.
All SDKs
EngageBySailthru
The EngageBySailthru class has been introduced to all the SDKs to facilitate a clear separation of logic between the core Marigold SDK functionality and the Sailthru only applications. This class is designed to house methods specific to Sailthru apps, providing a more organized and focused approach to SDK usage.
The EngageBySailthru class constructor includes a check for the app type. If the app type is determined to be non-Sailthru, an error will be thrown. This ensures that developers are aware of and prevented from using functionality that is not applicable to their specific app type.
The EngageBySailthru class includes methods that are specific to Sailthru applications. Developers should utilize these methods for Sailthru-related functionality. Here are the following methods moved from the Marigold class to EngageBySailthru.
- trackPageview
- trackImpression
- trackClick
- setUserEmail
- setUserId
- logEvent
- setProfileVars
- getProfileVars
- handleSailthruLink
- logPurchase
- logAbandonedCart
- setAttributes (deprecated)
- removeAttribute (deprecated)
- clearAttributes (deprecated) -> This has been split out from the
clearDevice
method in theMarigold
class
The methods marked as deprecated should be removed or replaced with setProfileVars as soon as possible as they will be removed in a future release.
Updated 11 months ago