MoEngageSDKInApp
@objc
public class MoEngageSDKInApp : NSObject
Class to configure to InApp
-
Singleton instance
Declaration
Swift
@objc public static let sharedInstance: MoEngageSDKInApp
-
Call this method to show Pop-up OR Fullscreen InApps inside the app for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func showInApp() -> MoEngageShowInAppTaskReturn Value
MoEngageShowInAppTaskthat resolves once the selected campaign has been rendered (after the configured display delay), or rejects withMoEngageInAppRequestFailureReason(.campaignNotFound/.renderFailed/.htmlAssetLoadFailed) or the shared.sdkNotInitializedcode. -
Call this method to show Pop-up OR Fullscreen InApps inside the app.
Declaration
Swift
@discardableResult @objc public func showInApp(forAppId appId: String? = nil) -> MoEngageShowInAppTaskParameters
appIdMoEngage Account Identifier.
Return Value
MoEngageShowInAppTask— seeshowInApp()for the resolve / reject contract.
-
Method to show non-intrusive nudge campaign at any available position for Default MoEngage Instance.
Declaration
Swift
@available(tvOS, unavailable) @discardableResult @objc public func showNudge() -> MoEngageShowNudgeTaskReturn Value
MoEngageShowNudgeTask— seeMoEngageShowNudgeTaskfor the resolve / reject contract. -
Method to show non-intrusive nudge campaign at any available position.
Declaration
Swift
@available(tvOS, unavailable) @discardableResult @objc public func showNudge(forAppId appId: String? = nil) -> MoEngageShowNudgeTaskParameters
appIdMoEngage Account Identifier.
Return Value
MoEngageShowNudgeTask— seeMoEngageShowNudgeTaskfor the resolve / reject contract. -
Method to show non-intrusive nudge campaign at the specified position if available for Default MoEngage Instance.
Declaration
Swift
@available(tvOS, unavailable) @discardableResult @objc public func showNudge(atPosition position: MoEngageNudgePosition = MoEngageNudgePosition.any) -> MoEngageShowNudgeTaskParameters
positionspecifies the position where the nudge has to be showed Top/Bottom.
Return Value
MoEngageShowNudgeTask— seeMoEngageShowNudgeTaskfor the resolve / reject contract. -
Method to show non-intrusive nudge campaign at the specified position if available.
Declaration
Swift
@available(tvOS, unavailable) @discardableResult @objc public func showNudge(atPosition position: MoEngageNudgePosition = MoEngageNudgePosition.any, forAppId appId: String? = nil) -> MoEngageShowNudgeTaskParameters
positionspecifies the position where the nudge has to be showed Top/Bottom.
appIdMoEngage Account Identifier.
Return Value
MoEngageShowNudgeTask— seeMoEngageShowNudgeTaskfor the resolve / reject contract.
-
Method to obtain self-handled inApp Campaign for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func getSelfHandledInApp() -> MoEngageGetSelfHandledInAppTaskReturn Value
MoEngageGetSelfHandledInAppTaskresolving withMoEngageGetSelfHandledInAppResultwhosecampaignisnilwhen no eligible self-handled campaign is available (a valid customer-observable state — not a failure). Rejects with.sdkNotInitializedif no instance matches. -
Method to obtain self-handled inApp Campaign.
Declaration
Swift
@discardableResult @objc public func getSelfHandledInApp(forAppId appId: String? = nil) -> MoEngageGetSelfHandledInAppTaskParameters
appIdMoEngage Account Identifier.
Return Value
MoEngageGetSelfHandledInAppTask— seegetSelfHandledInApp()for the contract. -
Deprecated. Use the typed-task-returning
getSelfHandledInApp()/getSelfHandledInApp(forAppId:)variants.Declaration
Swift
@available(*, deprecated, message: "Use the typed-task-returning getSelfHandledInApp(﹚ variant; attach onSuccess to receive the campaign.") @objc public func getSelfHandledInApp(completionBlock: @escaping ((_ campaignInfo: MoEngageInAppSelfHandledCampaign?, _ accountMeta: MoEngageAccountMeta?) -> Void)) -
Deprecated. Use the typed-task-returning
getSelfHandledInApp(forAppId:)variant.Declaration
Swift
@available(*, deprecated, message: "Use the typed-task-returning getSelfHandledInApp(forAppId:﹚ variant; attach onSuccess to receive the campaign.") @objc public func getSelfHandledInApp(forAppId appId: String? = nil, completionBlock: @escaping ((_ campaignInfo: MoEngageInAppSelfHandledCampaign?, _ accountMeta: MoEngageAccountMeta?) -> Void)) -
Method to get multiple self-handled inApp Campaigns for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func getSelfHandledInApps() -> MoEngageGetSelfHandledInAppsTaskReturn Value
MoEngageGetSelfHandledInAppsTaskresolving withMoEngageGetSelfHandledInAppsResultwhosecampaignsmay be empty. -
Method to get multiple self-handled inApp Campaigns.
Declaration
Swift
@discardableResult @objc public func getSelfHandledInApps(forAppId appId: String? = nil) -> MoEngageGetSelfHandledInAppsTaskParameters
appIdMoEngage Account Identifier.
Return Value
MoEngageGetSelfHandledInAppsTask— seegetSelfHandledInApps(). -
Deprecated. Use the typed-task-returning
getSelfHandledInApps()variant.Declaration
Swift
@available(*, deprecated, message: "Use the typed-task-returning getSelfHandledInApps(﹚ variant; attach onSuccess to receive the campaigns.") @objc public func getSelfHandledInApps(completionBlock: @escaping (_ campaignData: MoEngageInAppSelfHandledData) -> Void) -
Deprecated. Use the typed-task-returning
getSelfHandledInApps(forAppId:)variant.Declaration
Swift
@available(*, deprecated, message: "Use the typed-task-returning getSelfHandledInApps(forAppId:﹚ variant; attach onSuccess to receive the campaigns.") @objc public func getSelfHandledInApps(for appId: String, completionBlock: @escaping (_ campaignData: MoEngageInAppSelfHandledData) -> Void) -
Method to be called if a self-handled InApp is shown inside the app for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func selfHandledShown(campaignInfo: MoEngageInAppSelfHandledCampaign) -> MoEngageSelfHandledTrackingTaskParameters
campaignInfoMoEngageInAppSelfHandledCampaign instance with the campaign info.
Return Value
MoEngageSelfHandledTrackingTaskresolving withMoEngageSelfHandledTrackingResultonce the impression has been accepted into the SDK’s tracking pipeline. -
Method to be called if a self-handled InApp is shown inside the app.
Declaration
Swift
@discardableResult @objc public func selfHandledShown(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil) -> MoEngageSelfHandledTrackingTaskParameters
campaignInfoMoEngageInAppSelfHandledCampaign instance with the campaign info.
appIdMoEngage Account Identifier.
Return Value
MoEngageSelfHandledTrackingTask— seeselfHandledShown(campaignInfo:). -
Method to be called if a self-handled InApp is clicked by the user for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func selfHandledClicked(campaignInfo: MoEngageInAppSelfHandledCampaign) -> MoEngageSelfHandledTrackingTask -
Method to be called if a self-handled InApp is clicked by the user.
Declaration
Swift
@discardableResult @objc public func selfHandledClicked(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil) -> MoEngageSelfHandledTrackingTask -
Method to be called if a self-handled InApp is dismissed by the user for Default MoEngage Instance.
Declaration
Swift
@discardableResult @objc public func selfHandledDismissed(campaignInfo: MoEngageInAppSelfHandledCampaign) -> MoEngageSelfHandledTrackingTask -
Method to be called if a self-handled InApp is dismissed by the user.
Declaration
Swift
@discardableResult @objc public func selfHandledDismissed(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil) -> MoEngageSelfHandledTrackingTask
-
Method to disable inApps module for Default MoEngage Instance.
Declaration
Swift
@objc public func disableInApps() -
Method to disable inApps module.
Declaration
Swift
@objc public func disableInApps(forAppId appId: String? = nil)Parameters
appIdMoEngage Account Identifier.
-
Call this method to block InApps in a particular ViewController for Default MoEngage Instance.
Declaration
Swift
@objc public func blockInApp(forViewController viewController: UIViewController) -
Call this method to block InApps in a particular ViewController.
Declaration
Swift
@objc public func blockInApp(forViewController viewController: UIViewController, forAppId appId: String? = nil)
-
Method to set the current inApp contexts for Default MoEngage instance.
Declaration
Swift
@objc public func setCurrentInAppContexts(_ contexts: [String]) -
Method to set the current inApp contexts.
Declaration
Swift
@objc public func setCurrentInAppContexts(_ contexts: [String], forAppId appId: String? = nil) -
Invalidate/reset the contexts set currently in the app for Default MoEngage instance.
Declaration
Swift
@objc public func invalidateInAppContexts() -
Invalidate/reset the contexts set currently in the app.
Declaration
Swift
@objc public func invalidateInAppContexts(forAppId appId: String? = nil)
-
Method to set delegate for the inApp Callbacks for Default MoEngage instance.
Declaration
Swift
@objc public func setInAppDelegate(_ delegate: MoEngageInAppNativeDelegate) -
Method to set delegate for the inApp Callbacks.
Declaration
Swift
@objc public func setInAppDelegate(_ delegate: MoEngageInAppNativeDelegate, forAppId appId: String? = nil) -
Method to reset the inApp Delegate for Default Instance for Default MoEngage instance.
Declaration
Swift
@objc public func resetInAppDelegate() -
Method to reset the inApp Delegate for Default Instance.
Declaration
Swift
@objc public func resetInAppDelegate(forAppId appId: String? = nil)