Skip to content

Commit

Permalink
Marigold iOS SDK 15.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnivalBot committed Feb 7, 2024
1 parent b6a4496 commit 4d6c5df
Show file tree
Hide file tree
Showing 89 changed files with 3,763 additions and 9 deletions.
26 changes: 26 additions & 0 deletions Marigold-Extension.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Pod::Spec.new do |s|
s.name = 'Marigold-Extension'
s.version = '15.0.0'
s.summary = 'Marigold iOS SDK for integrating with https://mobile.sailthru.com messaging and analytics service.'
s.author = {
'Marigold' => '[email protected]'
}
s.homepage = 'http://docs.mobile.sailthru.com/'
s.source = {
:git => 'https://github.com/sailthru/sailthru-mobile-ios-sdk.git',
:tag => s.version.to_s
}
s.xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/MarigoldExtension/**"'
}
s.platform = :ios
s.ios.deployment_target = '12.0'
s.license = {:type => 'commercial', :text =>'Please refer to our privacy policy and terms of service at https://www.sailthru.com/legal'}
s.requires_arc = true
s.module_name = 'MarigoldExtension'
s.source_files = 'MarigoldExtension.xcframework/ios-*[!-simulator]/MarigoldExtension.framework/Headers/*.h'
s.vendored_frameworks = 'MarigoldExtension.xcframework'
s.public_header_files = 'MarigoldExtension.xcframework/ios-*[!-simulator]/MarigoldExtension.framework/Headers/*.h'
s.preserve_paths = 'MarigoldExtension.xcframework'
s.frameworks = 'Foundation', 'UserNotifications'
end
26 changes: 26 additions & 0 deletions Marigold.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Pod::Spec.new do |s|
s.name = 'Marigold'
s.version = '15.0.0'
s.summary = 'Marigold iOS SDK for integrating with https://mobile.sailthru.com messaging and analytics service.'
s.author = {
'Marigold' => '[email protected]'
}
s.homepage = 'http://docs.mobile.sailthru.com/'
s.source = {
:git => 'https://github.com/sailthru/sailthru-mobile-ios-sdk.git',
:tag => s.version.to_s
}
s.xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Marigold/**"'
}
s.platform = :ios
s.ios.deployment_target = '12.0'
s.license = {:type => 'commercial', :text =>'Please refer to our privacy policy and terms of service at https://www.sailthru.com/legal'}
s.requires_arc = true
s.source_files = 'Marigold.xcframework/ios-*[!-simulator]/Marigold.framework/Headers/*.h'
s.resources = 'Marigold.xcframework/ios-*[!-simulator]/Marigold.framework/*.png'
s.vendored_frameworks = 'Marigold.xcframework'
s.public_header_files = 'Marigold.xcframework/ios-*[!-simulator]/Marigold.framework/Headers/*.h'
s.preserve_paths = 'Marigold.xcframework'
s.frameworks = 'UIKit', 'Foundation', 'CoreLocation', 'CoreGraphics', 'QuartzCore', 'UserNotifications'
end
44 changes: 44 additions & 0 deletions Marigold.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>Marigold.framework/Marigold</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Marigold.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Marigold.framework/Marigold</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Marigold.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
//
// EngageBySailthru.h
// Sailthru Mobile
//
// Created by Angelo Esquibel on 12/4/23.
// Copyright © 2023 Sailthru. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN

@interface EngageBySailthru : NSObject

- (instancetype)init NS_UNAVAILABLE;

/**
* Create a new instance of the EngageBySailthru class. Returns an error if `startEngine` has not been called
* or if the EngageBySailthru functionality is not available.
*/
- (instancetype _Nullable)initWithError:(NSError **)error NS_SWIFT_NAME(init());

/**
* Enables AutoAnalytics tracking for a given array of event sources. This is opt-in as of Sailthru Mobile 5.0.0.
*
* @param enableArray - An array of const strings beginning with MARAutoAnalyticsSource.
*/
- (void)enableAutoAnalytics:(NSArray<NSString *> *)enableArray;

/** @name Custom Attributes */

/**
* Asyncronously sets a MARAttributes object with Sailthru Mobile.
*
* @param attributes A nonnull MARAttributes object with the desired attributes set.
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)setAttributes:(MARAttributes *)attributes withResponse:(nullable void(^)(NSError *__nullable error))block __deprecated_msg("use setProfileVars:withResponse: instead");

/**
* Asyncronously removes a value for a given key.
*
* @param key The string value of the key.
* @param block The block returned from the asynchronous call. May contain an error.
**/
- (void)removeAttributeWithKey:(NSString *)key withResponse:(nullable void(^)(NSError *__nullable error))block __deprecated_msg("use setProfileVars:withResponse: instead");

/**
* Asyncronously clears the Attribute data from the device.
* Use this method to clear the device attributes after user logout.
*
* @param block The block returned from the asynchronous call. May contain an error.
**/

- (void)clearAttributesWithResponse:(nullable void(^)(NSError *__nullable error))block __deprecated_msg("use setProfileVars:withResponse: instead");

/** @name Sailthru Link Handling */

/**
* If you're using Sailthru email combined with universal links, your application will open with an encoded Sailthru 'link' url.
* This method will decode the link URL and return its destination URL, as well as making sure that the clickthrough metrics for this link are correctly attributed in Sailthru.
* This method should be called from your AppDelegate's `application:continueUserActivity:restorationHandler:` method.
*
* @param url the Sailthru Link to be unrolled
* @return the destination that the Sailthru link points to, or nil if the link isn't a valid Sailthru Link.
*/
- (NSURL * _Nullable)handleSailthruLink:(NSURL *)url;

/** @name Events */

/**
* Logs a custom event with the given name.
*
* @param name The name of the custom event to be logged.
*/
- (void)logEvent:(NSString *)name;

/**
* Logs a custom event with the given name and associated vars.
*
* @param name The name of the custom event to be logged.
* @param vars The associated variables for the event.
*/
- (void)logEvent:(NSString *)name withVars:(NSDictionary<NSString *, id> *__nullable)vars;

/** @name Users */

/**
* Sets a user email for the device.
*
* @param userEmail The email of the user to be set.
*
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)setUserEmail:(nullable NSString *)userEmail withResponse:(nullable void(^)(NSError *__nullable error))block;

/**
* Sets a user ID for the device.
*
* @param userId The ID of the user to be set.
*
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)setUserId:(nullable NSString *)userId withResponse:(nullable void(^)(NSError *__nullable error))block;

/** @name Tracking */

/**
* Registers that the given pageview with Sailthru SPM.
*
* @param url The URL of the content we're tracking a view of. Must be a valid URL with protocol http:// or https:// -
* this generally should correspond to the web link of the content being tracked, and the stored URL in the Sailthru content collection
* @param tags Tags for this content
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)trackPageviewWithUrl:(NSURL *)url andTags:(NSArray<NSString *> *)tags andResponse:(nullable void(^)(NSError *__nullable error))block;

/**
* Registers that the given pageview with Sailthru SPM.
*
* @param url The URL of the content we're tracking a view of. Must be a valid URL with protocol http:// or https:// -
* this generally should correspond to the web link of the content being tracked, and the stored URL in the Sailthru content collection
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)trackPageviewWithUrl:(NSURL *)url andResponse:(nullable void(^)(NSError *__nullable error))block;

/**
* Registers an impression - a reasonable expectation that a user has seen a piece of content - with Sailthru SPM.
*
* @param sectionID the Section ID on Sailthru SPM corresponding to the section being viewed
* @param urls a List of the URLs of the items contained within this section. Useful if multiple items
* of content are contained within a section, otherwise just pass a single-item array.
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)trackImpressionWithSection:(NSString *)sectionID andUrls:(NSArray<NSURL *> *)urls andResponse:(nullable void(^)(NSError *__nullable error))block;

/**
* Registers an impression - a reasonable expectation that a user has seen a piece of content - with Sailthru SPM.
*
* @param sectionID the Section ID on Sailthru SPM corresponding to the section being viewed
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)trackImpressionWithSection:(NSString *)sectionID andResponse:(nullable void(^)(NSError *__nullable error))block;

/**
* Tracks with Sailthru SPM that a section has been tapped on, transitioning the user to a detail view
*
* @param sectionID the Section ID on Sailthru SPM corresponding to the section being tapped
* @param url the URL of the detail being transitioned to
* @param block The block returned from the asynchronous call. May contain an error.
*/
- (void)trackClickWithSection:(NSString *)sectionID andUrl:(NSURL *)url andResponse:(nullable void(^)(NSError *__nullable error))block;

/** @name Profile Vars*/

/**
* Sets the profile vars on the server.
*
* @param vars the vars to set on the server.
* @param block the block returned from the asynchronous call. May contain an error.
*/
- (void)setProfileVars:(NSDictionary<NSString *, id> *)vars withResponse:(nullable void(^)(NSError * _Nullable))block;

/**
* Retrieves the profile vars from the server.
*
* @param block the block returned from the asynchronous call. May contain an error.
*/
- (void)getProfileVarsWithResponse:(nullable void(^)(NSDictionary<NSString *, id> * _Nullable, NSError * _Nullable))block;

/** @name Purchases*/

/**
* Logs a purchase with Sailthru platform. This can be used for mobile purchase attribution.
*
* @param purchase The purchase to log with the platform.
* @param block The block to handle the result of the call. May contain an error if the call failed.
*/
- (void)logPurchase:(MARPurchase *)purchase withResponse:(nullable void(^)(NSError * _Nullable))block;

/**
* Logs a cart abandonment with the Sailthru platform. Use this to initiate cart abandoned flows.
*
* @param purchase The abandoned purchase to log with the platform.
* @param block The block to handle the result of the call. May contain an error if the call failed.
*/
- (void)logAbandonedCart:(MARPurchase *)purchase withResponse:(nullable void(^)(NSError * _Nullable))block;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
//
// MARAttributes.h
// Sailthru Mobile
//
// Created by Sailthru Mobile.
// Copyright © 2019 Sailthru. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, MARAttributesMergeRule) {
MARAttributesMergeRuleUpdate,
MARAttributesMergeRuleReplace
};

@interface MARAttributes : NSObject

/**
* Sets a string object for a given key. The key must not be nil.
*
* @param string The string to set.
* @param key The key to set.
*/
- (void)setString:(nullable NSString *)string forKey:(nonnull NSString *)key;

/**
* Sets an array of string objects for a given key. All items in the array must be of type NSString. The key must not be nil.
*
* @param strings The array of strings to set.
* @param key The key to set.
*/
- (void)setStrings:(nullable NSArray<NSString *> *)strings forKey:(nonnull NSString *)key;

/**
* Sets a date objects for a given key. The key must not be nil.
*
* @param date The date to set.
* @param key The key to set.
*/
- (void)setDate:(nullable NSDate *)date forKey:(nonnull NSString *)key;

/**
* Sets an array of date objects for a given key. All items in the array must be of type NSDate. The key must not be nil.
*
* @param dates The array of dates to set.
* @param key The key to set.
*/
- (void)setDates:(nullable NSArray<NSDate *> *)dates forKey:(nonnull NSString *)key;

/**
* Sets an integer object for a given key. The key must not be nil.
*
* @param integer The integer to set.
* @param key The key to set.
*/
- (void)setInteger:(NSInteger)integer forKey:(nonnull NSString *)key;


/**
* Sets an array of integers objects for a given key. All items in the array must be of type NSNumber (constructed with an NSInteger). The key must not be nil.
*
* @param integers The array of integers to set.
* @param key The key to set.
*/
- (void)setIntegers:(nullable NSArray<NSNumber *> *)integers forKey:(nonnull NSString *)key;

/**
* Sets a boolean object for a given key. The key must not be nil.
*
* @param aBool The boolean to set.
* @param key The key to set.
*/
- (void)setBool:(BOOL)aBool forKey:(nonnull NSString *)key;

/**
* Sets a float object for a given key. The key must not be nil.
*
* @param aFloat The float to set.
* @param key The key to set.
*/
- (void)setFloat:(CGFloat)aFloat forKey:(nonnull NSString *)key;

/**
* Sets an array of floats objects for a given key. All items in the array must be of type NSNumber (constructed with a CGFloat). The key must not be nil.
*
* @param floats The array of floats to set.
* @param key The key to set.
*/
- (void)setFloats:(nullable NSArray<NSNumber *> *)floats forKey:(nonnull NSString *)key;

/**
* Sets the method of merging on the attributes. MARAttributesMergeRuleUpdate will merge with existing attributes and MARAttributesMergeRuleReplace will replace all data with the new set.
*
* @param mergeRule The MARAttributesMergeRule to use. The default is update.
*/
- (void)setAttributesMergeRule:(MARAttributesMergeRule)mergeRule;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 4d6c5df

Please sign in to comment.