RInAppMessaging

@objc
public final class RInAppMessaging : NSObject

Class that contains the public methods for host application to call. Entry point for host application to communicate with InAppMessaging. Conforms to NSObject and exposed with objc tag to make it work with Obj-c projects.

  • If set to true, displayed campaigns will have different view hierarchy allowing accessibility tools to see visible UI elements. If you use Appium for UI tests automation - set this property to true. Default value is false

    Note

    There is a possibility that changing this property will cause campaigns to display incorrectly

    Declaration

    Swift

    @objc
    public static var accessibilityCompatibleDisplay: Bool { get set }
  • An optional callback called only for campaigns with defined context just before displaying its message. Return false to prevent the message from displaying.

    Declaration

    Swift

    @objc
    public static var onVerifyContext: ((_ contexts: [String], _ campaignTitle: String) -> Bool)? { get set }
  • A closure called whenever any internal error occurs. This functionality is made for debugging purposes to provide more information for developers.

    Declaration

    Swift

    @objc
    public static var errorCallback: ((NSError) -> Void)? { get set }
  • User Notification Authorization Options used in Push Primer feature. Value of this property will be used to register for remote notifications. The default value is [.sound, .alert, .badge]

    Declaration

    Swift

    @objc
    public static var pushPrimerAuthorizationOptions: UNAuthorizationOptions
  • Function to be called by host application to start a new thread that configures Rakuten InAppMessaging SDK.

    Declaration

    Swift

    @objc
    public static func configure(subscriptionID: String? = nil,
                                 configurationURL: String? = nil,
                                 enableTooltipFeature: Bool = false)

    Parameters

    subscriptionKey

    your app’s subscription key. (This setting will override the InAppMessagingAppSubscriptionID value in Info.plist)

    configurationURL

    a configuration URL. (This setting will override the InAppMessagingConfigurationURL value in Info.plist)

    enableTooltipFeature

    set to true to enable Tooltip campaigns. This feature is currently in beta phase. Default value: false.

  • Log the event name passed in and also pass the event name to the view controller to display a matching campaign.

    Declaration

    Swift

    @objc
    public static func logEvent(_ event: Event)

    Parameters

    event

    The Event object to log.

  • Register user preference object to the IAM SDK.

    Registered object should be updated to reflect current user session state. Should only be called once unless new UserInfoProvider object has been created.

    Note

    This method creates a strong reference to provided object.

    Declaration

    Swift

    @objc
    public static func registerPreference(_ provider: UserInfoProvider)

    Parameters

    provider

    object that will always contain up-to-date user information.

  • Close currently displayed campaign’s message.

    This method should be called when app needs to force-close the displayed message without user action. Campaign’s impressions won’t be sent (i.e. the message won’t be counted as displayed)

    Declaration

    Swift

    @objc
    public static func closeMessage(clearQueuedCampaigns: Bool = false)

    Parameters

    clearQueuedCampaigns

    when set to true, it will clear also the list of campaigns that were triggered and are queued to be displayed.

  • Close currently displayed tooltip that’s bound to a UI element with given identifier.

    This method should be called when app needs to force-close displayed tooltip without user action. Tooltip’s impressions won’t be sent (i.e. the message won’t be counted as displayed)

    Declaration

    Swift

    @objc
    public static func closeTooltip(with uiElementIdentifier: String)

    Parameters

    uiElementIdentifier

    accessibilityIdentifier of UI element that displayed tooltip is attached to. (a.k.a. UIElement parameter in tooltip JSON payload)