InAppMessageButton

Hierarchy

  • InAppMessageButton

Index

Constructors

constructor

  • new InAppMessageButton(text: string, backgroundColor?: number, textColor?: number, borderColor?: number, clickAction?: ClickAction, uri?: string, id?: number): InAppMessageButton
  • Represents a button on an ModalMessage or FullScreenMessage.

    Parameters

    • text: string

      The text to display on this button

    • Optional backgroundColor: number

      The background color for this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

    • Optional textColor: number

      The color for the text of this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

    • Optional borderColor: number

      The color for the border of this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

    • Optional clickAction: ClickAction

      Where the user should be brought when clicking on this button. See the InAppMessage.ClickAction enum.

    • Optional uri: string

      If clickAction is InAppMessage.ClickAction.URI, the URI to follow when the user clicks on this button.

    • Optional id: number

      The id for this button. Used for analytics.

    Returns InAppMessageButton

Properties

backgroundColor

backgroundColor: number

The background color for this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

borderColor

borderColor: number

The color for the border of this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

clickAction

clickAction: ClickAction

Where the user should be brought when clicking on this button. See the InAppMessage.ClickAction enum.

Optional id

id: number

The id for this button. Used for analytics.

text

text: string

The text to display on this button

textColor

textColor: number

The color for the text of this button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).

Optional uri

uri: string

If clickAction is InAppMessage.ClickAction.URI, the URI to follow when the user clicks on this button.

Methods

removeAllSubscriptions

  • removeAllSubscriptions(): void
  • Remove all event subscriptions from this button.

    Returns void

removeSubscription

  • removeSubscription(subscriptionGuid: string): void
  • Remove an event subscription that you previously subscribed to.

    Parameters

    • subscriptionGuid: string

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

    Returns void

subscribeToClickedEvent

  • subscribeToClickedEvent(subscriber: () => void): string
  • Subscribe to receive click events on this button. The subscriber callback will be called whenever this button is clicked by the user.

    Parameters

    • subscriber: () => void

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

        • (): void
        • Returns void

    Returns string

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