MoEngageSDKInApp

@objc
public class MoEngageSDKInApp : NSObject

Class to configure to InApp

  • Singleton instance

    Declaration

    Swift

    @objc
    public static let sharedInstance: MoEngageSDKInApp

General Campaigns

  • Call this method to show Pop-up OR Fullscreen InApps inside the app for Default MoEngage Instance

    Declaration

    Swift

    @objc
    public func showInApp()
  • Call this method to show Pop-up OR Fullscreen InApps inside the app.

    Declaration

    Swift

    @objc
    public func showInApp(forAppId appId: String? = nil)

    Parameters

    appId

    MoEngage Account Identifier.

Nudge Campaigns

  • Method to show non-intrusive nudge campaign at any available position for Default MoEngage Instance.

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func showNudge()
  • Method to show non-intrusive nudge campaign at any available position.

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func showNudge(forAppId appId: String? = nil)

    Parameters

    appId

    MoEngage Account Identifier.

  • Method to show non-intrusive nudge campaign at the specified position if available for Default MoEngage Instance.

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func showNudge(atPosition position: MoEngageNudgePosition = NudgePositionAny)

    Parameters

    position

    specifies the position where the nudge has to be showed Top/Bottom.

  • Method to show non-intrusive nudge campaign at the specified position if available.

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func showNudge(atPosition position: MoEngageNudgePosition = NudgePositionAny, forAppId appId: String? = nil)

    Parameters

    position

    specifies the position where the nudge has to be showed Top/Bottom.

    appId

    MoEngage Account Identifier.

Self Handled Campaigns

  • Method to obtain self-handled inApp Campaign for Default MoEngage Instance.

    Declaration

    Swift

    @objc
    public func getSelfHandledInApp(completionBlock: @escaping ((_ campaignInfo: MoEngageInAppSelfHandledCampaign?, _ accountMeta: MoEngageAccountMeta?) -> Void))

    Parameters

    completionBlock

    Completion Block which provides MoEngageInAppSelfHandledCampaign* instance(campaignInfo), incase one is active and satisfies all the rule checks OR else campaignInfo will be nil.

  • Method to obtain self-handled inApp Campaign.

    Declaration

    Swift

    @objc
    public func getSelfHandledInApp(forAppId appId: String? = nil, completionBlock: @escaping ((_ campaignInfo: MoEngageInAppSelfHandledCampaign?, _ accountMeta: MoEngageAccountMeta?) -> Void))

    Parameters

    appId

    MoEngage Account Identifier.

    completionBlock

    Completion Block which provides MoEngageInAppSelfHandledCampaign* instance(campaignInfo), incase one is active and satisfies all the rule checks OR else campaignInfo will be nil.

  • Method to be called if a self-handled InApp is shown inside the app for Default MoEngage Instance.

    Declaration

    Swift

    @objc
    public func selfHandledShown(campaignInfo: MoEngageInAppSelfHandledCampaign)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

  • Method to be called if a self-handled InApp is shown inside the app.

    Declaration

    Swift

    @objc
    public func selfHandledShown(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

    appId

    MoEngage Account Identifier.

  • Method to be called if a self-handled InApp is clicked by the user for Default MoEngage Instance

    Declaration

    Swift

    @objc
    public func selfHandledClicked(campaignInfo: MoEngageInAppSelfHandledCampaign)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

  • Method to be called if a self-handled InApp is clicked by the user

    Declaration

    Swift

    @objc
    public func selfHandledClicked(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

    appId

    MoEngage Account Identifier.

  • Method to be called if a self-handled InApp is dismissed by the user for Default MoEngage Instance

    Declaration

    Swift

    @objc
    public func selfHandledDismissed(campaignInfo: MoEngageInAppSelfHandledCampaign)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

  • Method to be called if a self-handled InApp is dismissed by the user

    Declaration

    Swift

    @objc
    public func selfHandledDismissed(campaignInfo: MoEngageInAppSelfHandledCampaign, forAppId appId: String? = nil)

    Parameters

    campaignInfo

    MoEngageInAppSelfHandledCampaign instance with the campaign info.

    appId

    MoEngage Account Identifier.

Disable InApps

  • 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

    appId

    MoEngage Account Identifier.

Block InApps

  • Call this method to block InApps in a particular ViewController for Default MoEngage Instance

    Declaration

    Swift

    @objc
    public func blockInApp(forViewController viewController: UIViewController)

    Parameters

    viewController

    UIViewController instance where InApps have to be blocked

  • Call this method to block InApps in a particular ViewController

    Declaration

    Swift

    @objc
    public func blockInApp(forViewController viewController: UIViewController, forAppId appId: String? = nil)

    Parameters

    viewController

    UIViewController instance where InApps have to be blocked

    appId

    MoEngage Account Identifier.

InApp Contexts

  • Method to set the current inApp contexts, so that campaign with contexts will only be shown when the current context contains the campaign context for Default MoEngage instance.

    Declaration

    Swift

    @objc
    public func setCurrentInAppContexts(_ contexts: [String])

    Parameters

    contexts

    Array of contexts

  • Method to set the current inApp contexts, so that campaign with contexts will only be shown when the current context contains the campaign context

    Declaration

    Swift

    @objc
    public func setCurrentInAppContexts(_ contexts: [String], forAppId appId: String? = nil)

    Parameters

    contexts

    Array of contexts

    appId

    MoEngage Account Identifier.

  • Call this methods to invalidate/reset the contexts set currently in the app for Default MoEngage instance.

    Declaration

    Swift

    @objc
    public func invalidateInAppContexts()
  • Call this methods to invalidate/reset the contexts set currently in the app.

    Declaration

    Swift

    @objc
    public func invalidateInAppContexts(forAppId appId: String? = nil)

    Parameters

    appId

    MoEngage Account Identifier.

InApp Delegate Handling

  • Method to set delegate for the inApp Callbacks for Default MoEngage instance.

    Declaration

    Swift

    @objc
    public func setInAppDelegate(_ delegate: MoEngageInAppNativeDelegate)

    Parameters

    delegate

    MoEngageInAppNative Delegate which will all the callbacks

  • Method to set delegate for the inApp Callbacks

    Declaration

    Swift

    @objc
    public func setInAppDelegate(_ delegate: MoEngageInAppNativeDelegate, forAppId appId: String? = nil)

    Parameters

    delegate

    MoEngageInAppNativeDelegate which will all the callbacks

    appId

    MoEngage Account Identifier.

  • 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)

    Parameters

    appId

    MoEngage Account Identifier.