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:

BeforeAfter
SailthruMobileMarigold
STMAttributesMARAttributes
STMContentItemMARContentItem
STMLoggerMARLogger
STMMessageMARMessage
STMMessageStreamMARMessageStream
STMNotificationCategoryMARNotificationCategory
STMPurchaseMARPurchase
STMPurchaseItemMARPurchaseItem

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:

BeforeAfter
com.sailthru.mobile.sdk.enums.EventSourcecom.marigold.sdk.enums.EventSource
com.sailthru.mobile.sdk.enums.ImpressionTypecom.marigold.sdk.enums.ImpressionType
com.sailthru.mobile.sdk.enums.NotificationActionStatecom.marigold.sdk.enums.NotificationActionState
com.sailthru.mobile.sdk.enums.NotificationPermissionRequestResultcom.marigold.sdk.enums.NotificationPermissionRequestResult

Interfaces:

BeforeAfter
com.sailthru.mobile.sdk.interfaces.ContentIntentBuildercom.marigold.sdk.interfaces.ContentIntentBuilder
com.sailthru.mobile.sdk.interfaces.Loggercom.marigold.sdk.interfaces.Logger
com.sailthru.mobile.sdk.interfaces.NotificationActionTappedListenercom.marigold.sdk.interfaces.NotificationActionTappedListener
com.sailthru.mobile.sdk.interfaces.NotificationReceivedListenercom.marigold.sdk.interfaces.NotificationReceivedListener
com.sailthru.mobile.sdk.interfaces.NotificationSilencercom.marigold.sdk.interfaces.NotificationSilencer
com.sailthru.mobile.sdk.interfaces.NotificationTappedListenercom.marigold.sdk.interfaces.NotificationTappedListener

Model:

BeforeAfter
com.sailthru.mobile.sdk.model.ActionTappedcom.marigold.sdk.model.ActionTapped
com.sailthru.mobile.sdk.model.AttributeMapcom.marigold.sdk.model.AttributeMap
com.sailthru.mobile.sdk.model.Messagecom.marigold.sdk.model.Message
com.sailthru.mobile.sdk.model.Purchasecom.marigold.sdk.model.Purchase
com.sailthru.mobile.sdk.model.PurchaseAdjustmentcom.marigold.sdk.model.PurchaseAdjustment
com.sailthru.mobile.sdk.model.PurchaseItemcom.marigold.sdk.model.PurchaseItem

Main:

BeforeAfter
(new class)com.marigold.sdk.EngageBySailthru
(new class)com.marigold.sdk.EngageBySailthruExtensions
com.sailthru.mobile.sdk.HttpErrorcom.marigold.sdk.HttpError
com.sailthru.mobile.sdk.SailthruMobilecom.marigold.sdk.Marigold
com.sailthru.mobile.sdk.SailthruMobileExtensionscom.marigold.sdk.MarigoldExtensions
com.sailthru.mobile.sdk.MessageActivitycom.marigold.sdk.MessageActivity
com.sailthru.mobile.sdk.MessageStreamcom.marigold.sdk.MessageStream
com.sailthru.mobile.sdk.MessageStreamExtensionscom.marigold.sdk.MessageStreamExtensions
com.sailthru.mobile.sdk.NotificationBundlecom.marigold.sdk.NotificationBundle
com.sailthru.mobile.sdk.NotificationCategorycom.marigold.sdk.NotificationCategory
com.sailthru.mobile.sdk.NotificationConfigcom.marigold.sdk.NotificationConfig
com.sailthru.mobile.sdk.NotificationExtendercom.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 the Marigold 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.