MoEngageInAppController
extension MoEngageInAppController: MoEngageTestInAppProtocol
-
Declaration
Swift
public func addSessionTerminationEvent(for reason: MoEngageTestInAppSessionTermination) -
Check non-instrusive inapp specific eligibility condition.
Declaration
Swift
func isNudgeCampaignEligible( _ campaignMeta: MoEngageInAppCampaignMeta, inPrioratizingStage: Bool ) -> BoolParameters
campaignMetaThe campaign metadata to check.
inPrioratizingStageWhether check is in priority stage.
Return Value
Whether campaign passes check.
-
Declaration
Swift
func performMetaSync(inAppFetchType: MoEngageInAppSyncType, previousIdentities: [String : String], withCompletionBlock completionBlock: @escaping (Bool) -> Void) -
Declaration
Swift
func getSelfHandledInAppPostSync() -
Declaration
Swift
func getSelfHandledInAppsPostSync() -
Declaration
Swift
@nonobjc func fetchRequestBodyResult(inAppFetchType: MoEngageInAppSyncType, previousIdentities: [String : String]) -> MoEngageRequestBodyBuildResult? -
Declaration
Swift
func fetchRequestBodyResultForTemplateFetch() -> [String : Any] -
Declaration
Swift
func getQueryParamsForMultipleCampaignsInAppRequest() -> [String : String] -
Declaration
Swift
func getSelfHandledInApps(completionBlock: @escaping (MoEngageInAppSelfHandledData?) -> Void) -
Declaration
Swift
func fetchMultipleCampaignsInAppRequest(for campaigns: [MoEngageInAppCampaignMeta], withCompletionBlock completion: @escaping (Bool, [AnyHashable : Any]?) -> Void) -
Declaration
Swift
func createCampaignsRequestPayload(from campaigns: [MoEngageInAppCampaignMeta]) -> [[String : Any]] -
Declaration
Swift
func trackTestInAppEvent(for event: MoEngageTestInAppEvents, attributes: [String : Any]? = nil) -
Declaration
Swift
func trackTriggerTestInAppEvent(for event: MoEngageTestInAppEvents, triggerEvent: String, attributes: [String : Any]? = nil) -
Declaration
Swift
func setTestInAppDelegate() -
Declaration
Swift
func performNewTestInAppFlow(for inApp: [String : Any]) -
Declaration
Swift
func trackInAppStat(_ statType: MoEngageInAppStatType, for campaignId: String, highPriorityCampaignIds: [String]) -
Declaration
Swift
func trackInAppStat(_ statType: MoEngageInAppStatType, for campaignId: String) -
Check if the given campaign payload represents an HTML nudge
Declaration
Swift
func isHTMLNudgeCampaign(payload: MoEngageInAppViewPayload) -> BoolParameters
payloadThe campaign payload to check
Return Value
True if the campaign is an HTML nudge, false otherwise
-
Reposition HTML nudge when orientation changes
Declaration
Swift
func repositionHTMLNudge(_ nudgeView: MoEngageInAppPrimaryContainerView)Parameters
nudgeViewThe nudge view to reposition
-
Extract campaign IDs from an array of campaign metadata
Declaration
Swift
func getCampaignIDsFromCampaigns(_ campaigns: [MoEngageInAppCampaignMeta]) -> [String]Parameters
campaignsArray of campaign metadata
Return Value
Array of campaign ID strings
-
Check if segment re-evaluation meta sync should be performed based on 3-minute interval
Declaration
Swift
func shouldPerformSegmentReevalMetaSync() -> BoolReturn Value
trueif sync should be performed (first sync or > 3 minutes since last sync),falseotherwise -
Handle segment re-evaluation failure when backend returns 412 error with E002 code This method is called from Objective-C which has already validated the 412/E002 error
Declaration
Swift
func handleSegmentReevalFailure( campaignMeta: MoEngageInAppCampaignMeta, responseData: [AnyHashable: Any]? )Parameters
campaignMetaThe campaign metadata that failed segment re-evaluation
responseDataThe parsed error response dictionary from the server
-
Calculate the frame for a HTML nudge based on its payload and position
Declaration
Swift
@objc public static func calculateNudgeFrame(_ payload: MoEngageInAppViewPayload) -> CGRectParameters
payloadThe InApp view payload containing style and position information
Return Value
The calculated CGRect for the nudge
-
Sync session and clear counters if session changed (called from Objective-C)
Declaration
Swift
@objc public func syncAndClearSessionCountersIfNeeded() -
Call this from application lifecycle events
Declaration
Swift
@objc public func syncFCSessionOnAppForeground() -
Call this from application lifecycle events Per technical doc: “On App background - Trigger sync if any data sync is pending”
Declaration
Swift
@objc public func triggerFCsyncOnAppBackground()
-
Check FC rules for a campaign (main entry point called from Objective-C)
Declaration
Swift
@objc public func checkFCRulesForCampaign(_ campaign: MoEngageInAppCampaignMeta, isPrioratizingStage: Bool) -> BoolParameters
campaignThe campaign to check
isPrioratizingStageWhether this is in prioritizing stage
Return Value
True if FC rules allow the campaign, false otherwise
-
Check FC rules for a campaign with explicit trigger type (called from Objective-C)
Declaration
Swift
@objc public func checkFCRulesForCampaign(_ campaign: MoEngageInAppCampaignMeta, triggerType: NSInteger, isPrioratizingStage: Bool) -> BoolParameters
campaignThe campaign to check
triggerTypeThe explicit trigger type as NSInteger (for Objective-C compatibility)
isPrioratizingStageWhether this is in prioritizing stage
Return Value
True if FC rules allow the campaign, false otherwise
-
Re-evaluate FC for impression tracking (called from Objective-C)
Declaration
Swift
@objc public func reEvaluateFCForImpressionWithCampaign(_ campaign: MoEngageInAppCampaign) -> BoolParameters
campaignThe campaign to re-evaluate
Return Value
True if FC rules still allow the campaign, false otherwise
-
Increment FC counters after campaign is shown (called from Objective-C)
Declaration
Swift
@objc public func incrementFCCountersForCampaign(_ campaign: MoEngageInAppCampaign) -
Processes frequency data from template payload and ingests it into FC state manager.
Declaration
Swift
@objc public func processFrequencyDataFromPayload(_ payload: MoEngageInAppViewPayload)Parameters
payloadThe view payload containing frequency data