UAInAppMessagingDelegate

Objective-C

@protocol UAInAppMessagingDelegate <NSObject>

Swift

protocol InAppMessagingDelegate : NSObjectProtocol

Delegate protocol for receiving in-app messaging related callbacks.

In App Messaging Delegate Methods

  • Allows the delegate to provide a custom display coordinator for the provided message.

    Declaration

    Objective-C

    - (nullable id<UAInAppMessageDisplayCoordinator>)displayCoordinatorForMessage:
        (nonnull UAInAppMessage *)message;

    Swift

    optional func displayCoordinator(for message: InAppMessage) -> InAppMessageDisplayCoordinator?

    Parameters

    message

    The message.

    Return Value

    An object implementing the UAInAppMessageDisplayCoordinator protocol or nil if no suitable display coordinator is available.

  • Allows the delegate to extend a message before display.

    Declaration

    Objective-C

    - (nonnull UAInAppMessage *)extendMessage:(nonnull UAInAppMessage *)message;

    Swift

    optional func extend(_ message: InAppMessage) -> InAppMessage

    Parameters

    message

    The message.

    Return Value

    An extended instance of the message.

  • Indicates that an in-app message will be displayed.

    Declaration

    Objective-C

    - (void)messageWillBeDisplayed:(nonnull UAInAppMessage *)message
                        scheduleID:(nonnull NSString *)scheduleID;

    Swift

    optional func messageWillBeDisplayed(_ message: InAppMessage, scheduleID: String)

    Parameters

    message

    The associated in-app message.

    scheduleID

    The schedule ID.

  • Indicates that an in-app message has finished displaying.

    Declaration

    Objective-C

    - (void)messageFinishedDisplaying:(nonnull UAInAppMessage *)message
                           scheduleID:(nonnull NSString *)scheduleID
                           resolution:
                               (nonnull UAInAppMessageResolution *)resolution;

    Swift

    optional func messageFinishedDisplaying(_ message: InAppMessage, scheduleID: String, resolution: InAppMessageResolution)

    Parameters

    message

    The associated in-app message.

    scheduleID

    The schedule ID.

    resolution

    The resolution info.

  • Allows the delegate to override the the choice of window scene for displaying the message.

    Declaration

    Objective-C

    - (nonnull UIWindowScene *)sceneForMessage:(nonnull UAInAppMessage *)message
                                  defaultScene:
                                      (nullable UIWindowScene *)defaultScene;

    Swift

    optional func scene(for message: InAppMessage, defaultScene: UIWindowScene?) -> UIWindowScene

    Parameters

    message

    The message.

    defaultScene

    The window scene chosen for displaying the message, or nil if one could not be found.

    Return Value

    A window scene if the delegate chooses to override the choice of scene, or nil otherwise.

  • Delegate method to check if an In-App message is ready for display or not. This method will be called for every message that is pending display whenever a display condition changes. Use notifyDisplayConditionsChanged to notify whenever a condition changes to reevaluate the pending In-App messages.

    This method is called on the main queue.

    Declaration

    Objective-C

    - (BOOL)isMessageReadyForDisplay:(nonnull UAInAppMessage *)message;

    Swift

    optional func isMessageReady(forDisplay message: InAppMessage) -> Bool

    Return Value

    true if the message is ready to be displayed, otherwise `false.