new SlideUpMessage(message, messageAlignment, slideFrom, extras, campaignId, cardId, triggerId, clickAction, uri, openTarget, dismissType, duration, icon, imageUrl, iconColor, iconBackgroundColor, backgroundColor, textColor, animateIn, animateOut)
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
message |
string | The message to display to the user. |
||
messageAlignment |
ab.InAppMessage.TextAlignment |
<optional> |
ab.InAppMessage.TextAlignment.CENTER | How to align message text. |
slideFrom |
ab.InAppMessage.SlideFrom |
<optional> |
ab.InAppMessage.SlideFrom.BOTTOM | Where the message should slide in from. |
extras |
array |
<optional> |
[] | Array of string/string key/value pairs. |
campaignId |
string |
<optional> |
If the message comes with a campaign, this is the id of the campaign that the SDK will report back to Appboy with in-app message analytics events. |
|
cardId |
string |
<optional> |
If the message comes with a card, this is the id of the card that the SDK will report back to Appboy with in-app message analytics events. |
|
triggerId |
string |
<optional> |
The id of the trigger that created this message. The SDK will report back this to Appboy with in-app message analytics events. |
|
clickAction |
ab.InAppMessage.ClickAction |
<optional> |
ab.InAppMessage.ClickAction.NEWS_FEED | Where the user should be brought when clicking on this message. |
uri |
string |
<optional> |
If |
|
openTarget |
ab.InAppMessage.OpenTarget |
<optional> |
ab.InAppMessage.OpenTarget.NONE | If |
dismissType |
ab.InAppMessage.DismissType |
<optional> |
ab.InAppMessage.DismissType.AUTO_DISMISS | How the message is dismissed, via a timer or requiring interaction from the user. |
duration |
integer |
<optional> |
5000 | Length of time in milliseconds until auto-dismiss should occur. Only used when dismissType is ab.InAppMessage.DismissType.AUTO_DISMISS |
icon |
string |
<optional> |
A Font Awesome unicode string, e.g. "\uf042" for fa-adjust. See the Font Awesome cheatsheet for details. |
|
imageUrl |
string |
<optional> |
Url of an image to include in this message. The message will only display an image or an icon, and will prioritize the image if present. |
|
iconColor |
integer |
<optional> |
0xffffffff | Color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green). |
iconBackgroundColor |
integer |
<optional> |
0xff0073d5 | Background color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green). |
backgroundColor |
integer |
<optional> |
0xe6000000 | Background color of entire message. Hex value with opacity (e.g. 0xff00ff00 is opaque green). |
textColor |
integer |
<optional> |
0xffffffff | Text color of message. Hex value with opacity (e.g. 0xff00ff00 is opaque green). |
animateIn |
boolean |
<optional> |
true | Whether to animate the showing of this message. |
animateOut |
boolean |
<optional> |
true | Whether to animate the hiding of this message. |
Extends
Methods
-
removeAllSubscriptions()
-
Remove all event subscriptions from this message.
- Inherited From:
-
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.
- Inherited From:
-
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.
- Inherited From:
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.
- Inherited From:
Returns:
The identifier of the subscription created. This can be passed to removeSubscription to cancel the subscription.
- Type
- string