UAInAppMessageAdapterProtocol

@protocol UAInAppMessageAdapterProtocol <NSObject>

In-app message adapter protocol. An adapter is responsible for displaying a particular type of 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: UAInAppMessage) -> 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: UAInAppMessageAssets, completionHandler: @escaping (UAInAppMessagePrepareResult) -> Void)

    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.

  • Displays the in-app message.

    Note

    This method is only called when running on iOS 12 and below.

    Declaration

    Objective-C

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

    Swift

    func display(_ completionHandler: @escaping (UAInAppMessageResolution) -> Void)

    Parameters

    completionHandler

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