Class: InAppMessage

InAppMessage

Abstract base for in-app messages. Use subclasses ab.SlideUpMessage, ab.ModalMessage and ab.FullScreenMessage.

<abstract> new InAppMessage()

Classes

Button

Members

<static, readonly> ClickAction :string

Enum to represent valid click actions for messages.

Type:
  • string
Properties:
Name Type Default Description
NEWS_FEED string NEWS_FEED
URI string URI
NONE string NONE

<static, readonly> CropType :string

Enum to represent how to crop a message's image.

Type:
  • string
Properties:
Name Type Default Description
CENTER_CROP string CENTER_CROP

Centers the image in the available space and crops any overflowing edges

FIT_CENTER string FIT_CENTER

Fits the image within the available space, causing blank space on the shorter axis (e.g. tall images will have bars of blank space on the left/right)

<static, readonly> DismissType :string

Enum to represent how messages should be dismissed.

Type:
  • string
Properties:
Name Type Default Description
AUTO_DISMISS string AUTO_DISMISS
MANUAL string SWIPE

<static, readonly> ImageStyle :string

Enum to represent how images on messages should be displayed.

Type:
  • string
Properties:
Name Type Default Description
TOP string TOP
GRAPHIC string GRAPHIC

<static, readonly> OpenTarget :string

Enum to represent how clicks on messages should be opened.

Type:
  • string
Properties:
Name Type Default Description
NONE string NONE
BLANK string BLANK

<static, readonly> Orientation :string

Enum to represent how messages should be oriented.

Type:
  • string
Properties:
Name Type Default Description
PORTRAIT string PORTRAIT
LANDSCAPE string LANDSCAPE

<static, readonly> SlideFrom :string

Enum to represent valid origins for messages to slide in from.

Type:
  • string
Properties:
Name Type Default Description
TOP string TOP
BOTTOM string BOTTOM

<static, readonly> TextAlignment :string

Enum to represent how text should be aligned.

Type:
  • string
Properties:
Name Type Default Description
START string START
CENTER string CENTER
END string END

Methods

removeAllSubscriptions()

Remove all event subscriptions from this message.

removeSubscription(subscriptionGuid)

Remove an event subscription that you previously subscribed to.

Parameters:
Name Type Description
subscriptionGuid string

The identifier of the subscription you wish to remove, returned by the method you initially used to create it.

subscribeToClickedEvent(subscriber) → {string}

Subscribe to receive click events. The subscriber callback will be called whenever this message is clicked by the user.

Parameters:
Name Type Description
subscriber function

The callback function to receive click events. This function will be invoked with no arguments when this message records a click.

Returns:

The identifier of the subscription created. This can be passed to removeSubscription to cancel the subscription.

Type
string

subscribeToDismissedEvent(subscriber) → {string}

Subscribe to receive dismissed events. The subscriber callback will be called whenever this message is closed by the user, or when it's dismissed automatically (depending on the dismissType).

Parameters:
Name Type Description
subscriber function

The callback function to receive dismissed events. This function will be invoked with no arguments when this message records a dismissal.

Returns:

The identifier of the subscription created. This can be passed to removeSubscription to cancel the subscription.

Type
string