UAInAppMessageAdapterProtocol

Objective-C

@protocol UAInAppMessageAdapterProtocol <NSObject>

Swift

protocol InAppMessageAdapterProtocol : NSObjectProtocol

In-app message adapter protocol. An adapter is responsible for displaying a particular type of in-app message.

  • Displays the in-app message.

    Declaration

    Objective-C

    - (void)display:
        (nonnull void (^)(UAInAppMessageResolution *_Nonnull))completionHandler;

    Swift

    optional func display() async -> InAppMessageResolution

    Parameters

    completionHandler

    the completion handler to be called when adapter has finished displaying the in-app message.

  • Factory method to create an in-app message adapter.

    Declaration

    Objective-C

    + (nonnull instancetype)adapterForMessage:(nonnull UAInAppMessage *)message;

    Swift

    static func adapter(for message: InAppMessage) -> Self

    Parameters

    message

    The in-app message.

  • Prepares in-app message to display.

    Declaration

    Objective-C

    - (void)prepareWithAssets:(nonnull UAInAppMessageAssets *)assets
            completionHandler:
                (nonnull void (^)(UAInAppMessagePrepareResult))completionHandler;

    Swift

    func prepare(with assets: InAppMessageAssets) async -> InAppMessagePrepareResult

    Parameters

    assets

    the assets for this in-app message

    completionHandler

    the completion handler to be called when adapter has finished preparing the in-app message.

  • Informs the adapter of the ready state of the in-app message immediately before display.

    Declaration

    Objective-C

    - (BOOL)isReadyToDisplay;

    Swift

    func isReadyToDisplay() -> Bool

    Return Value

    YES if the in-app message is ready, NO otherwise.