MoEngageSDKCards
@objc
public class MoEngageSDKCards : NSObject, @unchecked Sendable
Class to configure Cards
-
Singleton instance
Declaration
Swift
@objc public static var sharedInstance: MoEngageSDKCards { get }
-
Set the Cards delegate
Declaration
Swift
public func setCardsDelegate( delegate: MoEngageCardsDelegate, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
delegatedelegate object
appIDMoEngage Account Identifier
-
Set the Cards delegate. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func setCardsDelegate( delegate: MoEngageCardsDelegate, forAppID appID: String? = nil ) -
Fetch Cards campaign for given category
Declaration
Swift
@available(*, deprecated, message: "This API is deprecated. Please use the newer API getCardData(for:appID:completionBlock:﹚") public func getCards( forCategory category: String, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ cards: [MoEngageCardCampaign], _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
categorycategory for which cards should be fetched.
appIDMoEngage Account Identifier
completionBlockcompletion block with cards campaign info and account info.
-
Fetch Cards campaign for given category. Objective-C compatible overload.
Declaration
Swift
@available(*, deprecated, message: "This API is deprecated. Please use the newer API getCardData(for:appID:completionBlock:﹚") @_disfavoredOverload @objc public func getCards( forCategory category: String, forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ cards: [MoEngageCardCampaign], _ accountMeta: MoEngageAccountMeta? ) -> Void ) -
Retrieves card information for a specified category
Declaration
Swift
public func getCardData( for category: String, appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, completionBlock: @escaping @MainActor(unsafe) (MoEngageCardData?) -> Void ) -
Retrieves card information for a specified category. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getCardData( for category: String, appID: String? = nil, completionBlock: @escaping @MainActor(unsafe) (MoEngageCardData?) -> Void ) -
Fetch ShowAllTab status.
Declaration
Swift
public func isAllCategoryEnabled( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) (Bool) -> Void )Parameters
appIDMoEngage Account Identifier
Return Value
true if All tab is shown else false
-
Fetch ShowAllTab status. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func isAllCategoryEnabled( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) (Bool) -> Void )
-
Fetch the latest cards after refreshing data with inbox sync interval.
Declaration
Swift
public func fetchCards( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardData?) -> Void )? = nil )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with cards data and account info
-
Fetch the latest cards after refreshing data with inbox sync interval. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func fetchCards( forAppID appID: String? = nil, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardData?) -> Void )? = nil )
-
Fetch Cards status
Declaration
Swift
public func getAllCardStatusDict( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ([[String: Any]]) -> Void )Parameters
appIDMoEngage Account Identifier
Return Value
Array of dictionary containing card status
-
Method to fetch Cards data
Declaration
Swift
public func getCardsData( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ cardsData: MoEngageCardsData?, _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with cards data and account info.
-
Method to fetch Cards data. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getCardsData( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ cardsData: MoEngageCardsData?, _ accountMeta: MoEngageAccountMeta? ) -> Void ) -
Fetch Cards categories
Declaration
Swift
public func getCardsCategories( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ categories: [String], _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with cards categories and account info.
-
Fetch Cards categories. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getCardsCategories( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ categories: [String], _ accountMeta: MoEngageAccountMeta? ) -> Void )
-
Track impression for loading CardsController
Declaration
Swift
public func cardsViewControllerLoaded( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
appIDMoEngage Account identifier
-
Track impression for loading CardsController. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardsViewControllerLoaded(forAppID appID: String? = nil) -
Dismiss CardsViewController
Declaration
Swift
public func cardsViewControllerDismissed( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
appIDMoEngage Account Identifier
-
Dismiss CardsViewController. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardsViewControllerDismissed(forAppID appID: String? = nil)
-
Fetch new cards count
Declaration
Swift
public func getNewCardsCount( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with new cards count and account info.
-
Fetch new cards count. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getNewCardsCount( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void ) -
Fetch unclicked cards count
Declaration
Swift
public func getUnclickedCardsCount( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with unclicked cards count and account info.
-
Fetch unclicked cards count. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getUnclickedCardsCount( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void ) -
Fetch clicked cards count
Declaration
Swift
public func getClickedCardsCount( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
appIDMoEngage Account Identifier
completionBlockcompletion block with clicked cards count and account info.
-
Fetch clicked cards count. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func getClickedCardsCount( forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ count: Int, _ accountMeta: MoEngageAccountMeta? ) -> Void )
-
Delete the cards
Declaration
Swift
public func deleteCards( _ cardsArr: [MoEngageCardCampaign], forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, andCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ isDeleted: Bool, _ accountMeta: MoEngageAccountMeta? ) -> Void )Parameters
cardsArrarray of
MoEngageCardCampaignappIDMoEngage Account Identifier
completionBlockcompletion block called once card is deleted.
-
Delete the cards. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func deleteCards( _ cardsArr: [MoEngageCardCampaign], forAppID appID: String? = nil, andCompletionBlock completionBlock: @escaping @MainActor(unsafe) ( _ isDeleted: Bool, _ accountMeta: MoEngageAccountMeta? ) -> Void )
-
Sync the cards from server
Declaration
Swift
public func syncCards( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletion completionBlock: ( @MainActor(unsafe) (_ success: Bool) -> Void )? = nil )Parameters
appIDMoEngage Account Identifier
completionBlockReturns true if sync is successful else false
-
Sync the cards from server. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func syncCards( forAppID appID: String? = nil, withCompletion completionBlock: ( @MainActor(unsafe) (_ success: Bool) -> Void )? = nil )Parameters
appIDMoEngage Account Identifier
completionBlockReturns true if sync is successful else false
-
Method to sync the cards with app open interval
Declaration
Swift
public func onAppOpenSync( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil )Parameters
appIDaccount identifier
completionBlockcompletion block to be called after sync is performed
-
Method to sync the cards with app open interval. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func onAppOpenSync( forAppID appID: String? = nil, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil ) -
Method to track inbox click and sync the cards with inbox load interval
Declaration
Swift
public func onCardSectionLoaded( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil )Parameters
appIDaccount identifier
completionBlockcompletion block to be called after sync is performed
-
Method to track inbox click and sync the cards with inbox load interval. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func onCardSectionLoaded( forAppID appID: String? = nil, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil ) -
Method to sync the cards with pull to refresh interval
Declaration
Swift
public func refreshCards( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil )Parameters
appIDaccount identifier
completionBlockcompletion block to be called after sync is performed
-
Method to sync the cards with pull to refresh interval. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func refreshCards( forAppID appID: String? = nil, withCompletion completionBlock: ( @MainActor(unsafe) (_ data: MoEngageCardSyncCompleteData?) -> Void )? = nil )
-
Track cards shown event and update delivery counters accordingly.
Declaration
Swift
public func cardShown( _ card: MoEngageCardCampaign, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
cardinstance of
MoEngageCardCampaignappIDMoEngage Account Identifier
-
Track cards shown event and update delivery counters accordingly. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardShown( _ card: MoEngageCardCampaign, forAppID appID: String? = nil ) -
Mark the card as clicked and tracks an event for statistical purpose.
Declaration
Swift
public func cardClicked( _ card: MoEngageCardCampaign, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
cardinstance of
MoEngageCardCampaignappIDMoEngage Account Identifier
-
Mark the card as clicked and tracks an event for statistical purpose. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardClicked( _ card: MoEngageCardCampaign, forAppID appID: String? = nil ) -
Mark a card as clicked and tracks an event for statistical purpose.
Declaration
Swift
public func cardClicked( _ card: MoEngageCardCampaign, withWidgetID widgetID: Int, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
cardinstance of
MoEngageCardCampaignwidgetIDunique identifier for the widget that was clicked
appIDMoEngage Account Identifier
-
Mark a card as clicked and tracks an event for statistical purpose. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardClicked( _ card: MoEngageCardCampaign, withWidgetID widgetID: Int, forAppID appID: String? = nil ) -
Mark card delivered event
Declaration
Swift
public func cardDelivered( _ card: MoEngageCardCampaign, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
cardinstance of
MoEngageCardCampaignappIDMoEngage Account Identifier
-
Mark card delivered event. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardDelivered( _ card: MoEngageCardCampaign, forAppID appID: String? = nil ) -
Method to mark tracking delivery of all cards to inbox.
Declaration
Swift
public func cardDelivered( forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation )Parameters
appIDaccount identifier.
-
Method to mark tracking delivery of all cards to inbox. Objective-C compatible overload.
Declaration
Swift
@_disfavoredOverload @objc public func cardDelivered(forAppID appID: String? = nil)
-
Present the CardsViewController
Declaration
Swift
@available(tvOS, unavailable) @MainActor @objc public func presentCardsViewController( withUIConfiguration config: MoEngageCardsUIConfiguration? = nil, withCardsViewControllerDelegate delegate: MoEngageCardsViewControllerDelegate? = nil, forAppID appID: String? = nil )Parameters
configCards config instance
delegateoptional cards delegate
appIDMoEngage Account Identifier
-
pushCardsViewController(toNavigationController:withUIConfiguration: withCardsViewControllerDelegate: forAppID: ) Push the CardsViewController
Declaration
Swift
@available(tvOS, unavailable) @MainActor @objc public func pushCardsViewController( toNavigationController navController: UINavigationController, withUIConfiguration config: MoEngageCardsUIConfiguration? = nil, withCardsViewControllerDelegate delegate: MoEngageCardsViewControllerDelegate? = nil, forAppID appID: String? = nil )Parameters
navControllerUINavigationController instance
configCards custom UI configuration
delegateoptional cards delegate
appIDMoEngage Account Identifier
-
getCardsViewController(withUIConfiguration:withCardsViewControllerDelegate: forAppID: withCompletionBlock: ) Method to return the CardsViewController
Declaration
Swift
@available(tvOS, unavailable) @MainActor @objc public func getCardsViewController( withUIConfiguration config: MoEngageCardsUIConfiguration? = nil, withCardsViewControllerDelegate delegate: MoEngageCardsViewControllerDelegate? = nil, forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping @MainActor(unsafe) (MoEngageCardsListViewController?) -> Void )Parameters
configCards custom UI configuration
delegateoptional cards delegate
appIDMoEngage Account Identifier
Return Value
MoEngageCardsListViewController