MarketingCloudSdk

Class

This class is a Swift Interface for SFMarketingCloudSdk

Requests the MarketingCloudSdk Module when it’s operational and safe to use. The provided callback will be invoked with the MarketingCloudSdk Module when it’s ready. All MarketingCloudSdk module-related API calls should be made within this function.


This method is to get the SDK metadata


Ask MarketingCloudSDK to update its data. MarketingCloudSDK will throttle attempts based on the time since the last time this was called.


Enable/Disable extra debug logging from the SDK.


Unified Logger initialized for ‘MarketingCloudSdk’ Module Usage Example: MarketingCloudSdk.shared.getLogger().d(category: .event, message: “Message”)


Returns: Contact key String that is set in the application.


Adds the provided Tag (NSString) to the set of unique tags.

Returns: YES if added successfully.


Adds the provided array of Tags (NSString) to the set of unique tags. Will trim leading and trailing whitespace. Cannot be nil or blank.

Returns: Set of tags added, as strings, or nil if something failed.


Removes the provided Tag (NSString) from the list of tags.

Returns: YES if removed successfully.


Returns the list of tags for this device.

Returns: All tags associated, as strings.


Returns a read-only copy of the Attributes dictionary as it is right now.


Returns the Salesforce application accessToken.


Returns the unique device identifier that Salesforce will use to identify the device.


Add a signedString security token for registration security


Returns the value of last stored signedString security token


Register a callback that will be notified when Registration related events happen @see: https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/sdk-implementation/user-data.html @param registrationCallback closure to be provided when registration event occurs


Removes the registration callback @see: https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/sdk-implementation/user-data.html


Developer override to set the state of analytics enablement to YES/NO. If set to NO, the SDK will stop tracking analytics and also purges all the analytics stored locally. This value takes precedence over the config setting which is passed during the SDK initialization.


The current state of the Analytics enablement override


Developer override to set the state of PI analytics enablement to YES/NO. If set to NO, the SDK will stop tracking PI analytics and also purges all the analytics stored locally. This value takes precedence over the config setting which is passed during the SDK initialization.


The current state of the PI Analytics enablement override


The current state of the Location enablement override


Developer override to set the state of Location enablement to YES/NO. If set to NO, the SDK will stop monitoring location and Location services are not available for the consuming application. This value takes precedence over the config setting which is passed during the SDK initialization.


The current state of the Inbox enablement override


Developer override to set the state of Inbox enablement to YES/NO. If set to NO, Inbox feature will be disabled. This value takes precedence over the config setting which is passed during the SDK initialization.


Returns an array of all messages that includes read, unread , deleted messages Public properties in inbox message dictionary

Returns: an Array of Dictionary containing all messages (read, unread and deleted)


Returns an array of unread messages Public properties in inbox message dictionary


Returns an array of read messages Public properties in inbox message dictionary


Returns an array of deleted messages Public properties in inbox message dictionary


Returns all messages count


Returns unread messages count


Returns read messages count


Returns deleted messages count


Mark the unread messages as read


Mark the messages as deleted


Mark the message with specific messageId as read


Mark the message with specific messageId as deleted


Mark all the messages with specific messageId as read


Mark all the messages with specific messageId as deleted


Fetches and refreshes messages from server Reload and refresh Inbox messages from the Marketing Cloud server. Note: The underlying request to the server will be throttled such that it will execute at most every 60 seconds. If the method has been called less than 60 seconds after the preceeding method call, NO will be returned and the request will not be made. If NO is returned, best practice is that any UI used to reflect the refresh operation is updated (pull to refresh indicators, loading spinners, etc.). DDoS Protection The SDK has several built in mechanisms to protect Marketing Cloud servers and services. For message GET routes, we allow at most one manual refresh request per minute. This prevents bad application implementations or mobile app users from calling refresh over and over when there will be no new data available. Within the SDK and it’s logging, this presents a 429 - Too Many Requests log statement. Throttling To protect the workload and ensure optimal performance, the Inbox Message routes may throttle incoming requests. This throttling is based on adaptive logic, which operates as a percentage of traffic depending on the current load. The system is designed to automatically determine when throttling is necessary or when it can be reduced. During periods of traffic throttling, some customer requests may receive a 429 - Too Many Requests response. This will log a 429 response within the SDK. The Marketing Cloud has considerable server-side logic to monitor and adjust this throttling mechanism. This method will cause notifications to be posted to NSNotificationCenter: SFMCInboxMessagesRefreshCompleteNotification: posted when the refresh process has completed SFMCInboxMessagesNewInboxMessagesNotification: posted if there are new Inbox messages


Set String identifier


Returns piIdentifier


Track the inbox messages that are opened in the app


Track the pageview visited in the page


Track contents in the cart


Track Conversion on the items in the cart


Returns cartItem Dictionary with specific price, quantity, item and Id


Returns cart Dictionary with cartItem


Returns order Dictionary with ordernumber, shipping number, discount, cart dictionary


Set location delegate


Returns region from collection of region


Returns if location is enabled in the SDK


Enables the co-ordinates tracking on the device


Disables the co-ordinates tracking on the device


Returns if location watching is enabled or not


Returns last known location