MoEngageAnalyticsHandler
extension MoEngageAnalyticsHandler
-
Tracks an event originating from a rich push notification.
Declaration
Swift
public func trackEventForRichNotification( name: String, properties: MoEngageProperties? = nil, forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation, completionBlock: (@Sendable () -> Void)? = nil )Parameters
nameThe event name to record.
propertiesOptional custom attributes to attach to the event.
sdkInstanceThe SDK instance to record the event against.
completionBlockCalled after the event has been added to the current batch.
-
handleOpenURL(_:Asynchronous) Processes a deep-link or universal-link URL across all active SDK instances.
For each instance the URL is dispatched as a
.didOpenmodule event so that analytics can update the session source. Live Activity and Campaigns managers receive the URL separately for their own handling.Must be called from
@MoEngageGlobalActorcontext (orawaited from any task).Declaration
Swift
@MoEngageGlobalActor public func handleOpenURL(_ url: URL) asyncParameters
urlThe URL that was opened.
-
Set boolean user attribute
Declaration
Swift
public static func setUserAttributeBool( _ value: Bool, withAttributeName attributeName: String, forAppID appID: String? = nil, isolation `actor`: isolated (any Actor)? = #isolation, file: StaticString = #fileID, line: UInt = #line, column: UInt = #column )Parameters
valueBoolean value i.e True/False
attributeNameattribute name
appIDMoEngage Account Identifier
-
Set boolean user attribute
Declaration
Swift
@objc public static func setUserAttributeBool( _ value: Bool, withAttributeName attributeName: String, forAppID appID: String? = nil )Parameters
valueBoolean value i.e True/False
attributeNameattribute name
appIDMoEngage Account Identifier
-
Update provisional push opt-in device attribute status.
Declaration
Swift
public static func pushProvisionalStatusUpdated( to status: Bool, forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) -
Fetch the user unique Id
Declaration
Swift
public static func getUserUniqueId(forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation) -> String? -
Fetch the user identities.
Declaration
Swift
public static func getUserIdentities( forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) -> [String: String] -
Flush current batch.
Declaration
Swift
public static func flush( forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation, allowEmptyFlush: Bool ) -
Fetch the current session ID
Declaration
Swift
public static func getCurrentSessionId( forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) -> String? -
Returns whether
urlis a recognised MoEngage source URL for the given instance.Declaration
Swift
public static func isValidSource( forInstance sdkInstance: isolated MoEngageSDKInstance = #isolation, withURL url: URL ) -> Bool -
Declaration
Swift
public func pushProvisionalStatusUpdated( to status: Bool, forSdkInstance sdkInstance: MoEngageSDKInstance ) -
Declaration
Swift
public func getUserUniqueId(for sdkInstance: MoEngageSDKInstance) -> String? -
Declaration
Swift
public func getUserIdentities(for sdkInstance: MoEngageSDKInstance) -> [String : String] -
Declaration
Swift
public func flush(for sdkInstance: MoEngageSDKInstance, allowEmptyFlush: Bool) -
Declaration
Swift
public func getCurrentSessionId(for sdkInstance: MoEngageSDKInstance) -> String? -
Declaration
Swift
public func isValidSource(for sdkInstance: MoEngageSDKInstance, withURL url: URL) -> Bool -
Declaration
Swift
public func getInSessionAttributes(sdkInstance: MoEngageSDKInstance) -> [String : Any] -
Tracks an event originating from a rich push notification.
Must be called on
sdkInstance.sdkQueue.Declaration
Swift
@available(*, deprecated, message: "Use trackEventForRichNotification(name:properties:forInstance:completionBlock:﹚ instead") public func trackEventForRichNotification( name: String, properties: MoEngageProperties? = nil, sdkInstance: MoEngageSDKInstance, completionBlock: (@Sendable () -> Void)? = nil ) -
Declaration
Swift
public static func pushProvisionalStatusUpdated(to status: Bool, forSdkInstance sdkInstance: MoEngageSDKInstance) -
Declaration
Swift
public static func getUserUniqueId(for sdkInstance: MoEngageSDKInstance) -> String? -
Declaration
Swift
public static func getUserIdentities(for sdkInstance: MoEngageSDKInstance) -> [String : String] -
Declaration
Swift
public static func flush(for sdkInstance: MoEngageSDKInstance, allowEmptyFlush: Bool) -
Declaration
Swift
public static func getCurrentSessionId(for sdkInstance: MoEngageSDKInstance) -> String? -
Declaration
Swift
public static func isValidSource(for sdkInstance: MoEngageSDKInstance, withURL url: URL) -> Bool