UAInAppMessageManager

@interface UAInAppMessageManager : UAComponent

Provides a control interface for creating, canceling and executing in-app message schedules.

  • In-app message enable flag.

    Declaration

    Objective-C

    @property (getter=isEnabled, assign, readwrite, nonatomic) BOOL enabled;

    Swift

    var isEnabled: Bool { get set }
  • In-app message display paused flag.

    Declaration

    Objective-C

    @property (getter=isPaused, assign, readwrite, nonatomic) BOOL paused;

    Swift

    var isPaused: Bool { get set }
  • In-app messaging delegate.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<UAInAppMessagingDelegate> _Nullable delegate;

    Swift

    weak var delegate: UAInAppMessagingDelegate? { get set }
  • Message display interval.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSTimeInterval displayInterval;

    Swift

    var displayInterval: TimeInterval { get set }
  • In-app messaging asset manager.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UAInAppMessageAssetManager *_Nonnull assetManager;

    Swift

    var assetManager: UAInAppMessageAssetManager { get }
  • Allows setting factory blocks that builds InAppMessageAdapters for each given display type.

    Declaration

    Objective-C

    - (void)setFactoryBlock:(nonnull id<UAInAppMessageAdapterProtocol> _Nonnull (^)(
                                UAInAppMessage *_Nonnull))factory
             forDisplayType:(UAInAppMessageDisplayType)displayType;

    Swift

    func setFactoryBlock(_ factory: @escaping (UAInAppMessage) -> UAInAppMessageAdapterProtocol, for displayType: UAInAppMessageDisplayType)

    Parameters

    displayType

    The display type.

    factory

    The adapter factory.

  • Schedules an in-app message.

    Declaration

    Objective-C

    - (void)scheduleMessageWithScheduleInfo:
                (nonnull UAInAppMessageScheduleInfo *)scheduleInfo
                          completionHandler:(nonnull void (^)(UASchedule *_Nonnull))
                                                completionHandler;

    Swift

    func scheduleMessage(with scheduleInfo: UAInAppMessageScheduleInfo, completionHandler: @escaping (UASchedule) -> Void)

    Parameters

    scheduleInfo

    The schedule info for the message.

    completionHandler

    The completion handler to be called when scheduling completes.

  • Schedules an in-app message.

    Declaration

    Objective-C

    - (void)scheduleMessageWithScheduleInfo:
                (nonnull UAInAppMessageScheduleInfo *)scheduleInfo
                                   metadata:(nullable NSDictionary *)metadata
                          completionHandler:(nonnull void (^)(UASchedule *_Nonnull))
                                                completionHandler;

    Swift

    func scheduleMessage(with scheduleInfo: UAInAppMessageScheduleInfo, metadata: [AnyHashable : Any]?, completionHandler: @escaping (UASchedule) -> Void)

    Parameters

    scheduleInfo

    The schedule info for the message.

    metadata

    The schedule optional metadata.

    completionHandler

    The completion handler to be called when scheduling completes.

  • Schedules multiple in-app messages.

    Declaration

    Objective-C

    - (void)scheduleMessagesWithScheduleInfo:
                (nonnull NSArray<UAInAppMessageScheduleInfo *> *)scheduleInfos
                                    metadata:(nullable NSDictionary *)metadata
                           completionHandler:
                               (nonnull void (^)(NSArray<UASchedule *> *_Nonnull))
                                   completionHandler;

    Swift

    func scheduleMessages(withScheduleInfo scheduleInfos: [UAInAppMessageScheduleInfo], metadata: [AnyHashable : Any]?, completionHandler: @escaping ([UASchedule]) -> Void)

    Parameters

    scheduleInfos

    The schedule info for the messages.

    metadata

    The schedules’ optional metadata.

    completionHandler

    The completion handler to be called when scheduling completes.

  • Cancels an in-app message via its schedule info.

    Declaration

    Objective-C

    - (void)cancelScheduleWithID:(nonnull NSString *)scheduleID;

    Swift

    func cancelSchedule(withID scheduleID: String)

    Parameters

    scheduleID

    The schedule ID for the message to be canceled.

  • Cancels in-app messages with the spcified message ID.

    Declaration

    Objective-C

    - (void)cancelMessagesWithID:(nonnull NSString *)identifier;

    Swift

    func cancelMessages(withID identifier: String)

    Parameters

    identifier

    The message ID.

  • Gets schedules with the provided identifier.

    Declaration

    Objective-C

    - (void)getScheduleWithID:(nonnull NSString *)identifier
            completionHandler:
                (nonnull void (^)(UASchedule *_Nonnull))completionHandler;

    Swift

    func getScheduleWithID(_ identifier: String, completionHandler: @escaping (UASchedule) -> Void)

    Parameters

    identifier

    The scheduler identifier corresponding to the in-app message to be fetched.

    completionHandler

    The completion handler to be called when fetch operation completes.

  • Gets schedules whose group is the provided message ID.

    Declaration

    Objective-C

    - (void)getSchedulesWithMessageID:(nonnull NSString *)messageID
                    completionHandler:
                        (nonnull void (^)(NSArray<UASchedule *> *_Nonnull))
                            completionHandler;

    Swift

    func getSchedulesWithMessageID(_ messageID: String, completionHandler: @escaping ([UASchedule]) -> Void)

    Parameters

    messageID

    The message ID.

    completionHandler

    The completion handler to be called when fetch operation completes.

  • Gets all schedules, including schedules that have ended.

    Declaration

    Objective-C

    - (void)getAllSchedules:
        (nonnull void (^)(NSArray<UASchedule *> *_Nonnull))completionHandler;

    Swift

    func getAllSchedules(_ completionHandler: @escaping ([UASchedule]) -> Void)

    Parameters

    completionHandler

    The completion handler to be called when fetch operation completes.

  • Edits a schedule.

    Declaration

    Objective-C

    - (void)editScheduleWithID:(nonnull NSString *)identifier
                         edits:(nonnull UAInAppMessageScheduleEdits *)edits
             completionHandler:
                 (nonnull void (^)(UASchedule *_Nullable))completionHandler;

    Swift

    func editSchedule(withID identifier: String, edits: UAInAppMessageScheduleEdits, completionHandler: @escaping (UASchedule?) -> Void)

    Parameters

    identifier

    A schedule identifier.

    edits

    The edits to apply.

    completionHandler

    The completion handler with the result.

  • Check display audience conditions.

    Declaration

    Objective-C

    - (void)checkAudience:(nonnull UAInAppMessageAudience *)audience
        completionHandler:
            (nonnull void (^)(BOOL, NSError *_Nullable))completionHandler;

    Swift

    func check(_ audience: UAInAppMessageAudience, completionHandler: @escaping (Bool, Error?) -> Void)

    Parameters

    audience

    The specified audience

    completionHandler

    Passed YES if the current user is a member of the specified audience, NO if the current user is not a member of the specified audience. Error is non-nil if there was an error evaluating the audience.