public class

AppAction

extends Object
implements Parcelable
java.lang.Object
   ↳ com.usebutton.sdk.models.AppAction

Class Overview

This is the main class holding all information regarding an AppAction, if you're implementing a custom button UI please refer to the Custom Button UI guide for more information. See getAction(String, ButtonContext, Button.ActionListener) and Preview for code examples.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
static AppAction fromDTO(ButtonDTO dto)
static AppAction fromDTO(AffiliatedLinkDTO dto)
Footer getFooter()
Header getHeader()
Link getLink()
ListBody getListBody()
MetaInfo getMeta()
Preview getPreview()
This object holds information about the preview for this app action, you will typically render this text & icon as a button or element that the user can click Most partners would just start the regular Button Card flow by invoking invokePreview(Context).
Product getProduct()
boolean hasGroups()
boolean hasProduct()
void invokeAction(Context context)
void invokeAction(Context context, int intentFlags)
Invoke an AppAction that have been acquired with getAction(String, Button.ActionListener) to open the action for this merchant ID.
void invokeFooter(Context context)
Invoke the footer element of a card, this will start the target application or open the Play Store.
void invokeFooter(Context context, int intentFlags)
Invoke the footer element of a card, this will start the target application or open the Play Store.
void invokeInventory(Context context, Inventory inventory)
Invoke an inventory item which will either open the target app for this item or start installation.
void invokeInventory(Context context, Inventory inventory, int intentFlags)
Invoke an inventory item which will either open the target app for this item or start installation.
void invokePreview(Context context, int intentFlags)
This method is deprecated. use #invokeAction(Context, intentFlags) instead.
void invokePreview(Context context)
This method is deprecated. use invokeAction(Context) instead.
String toString()
void trackButtonViewed(Context context)
Reporting views is important to measure the performance of your button.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Methods

public static AppAction fromDTO (ButtonDTO dto)

public static AppAction fromDTO (AffiliatedLinkDTO dto)

public Footer getFooter ()

public Header getHeader ()

public Link getLink ()

public ListBody getListBody ()

public MetaInfo getMeta ()

public Preview getPreview ()

This object holds information about the preview for this app action, you will typically render this text & icon as a button or element that the user can click Most partners would just start the regular Button Card flow by invoking invokePreview(Context).

public Product getProduct ()

public boolean hasGroups ()

public boolean hasProduct ()

public void invokeAction (Context context)

public void invokeAction (Context context, int intentFlags)

Invoke an AppAction that have been acquired with getAction(String, Button.ActionListener) to open the action for this merchant ID.

Parameters
intentFlags special intentFlags that will be used when starting the target application. For most cases you can pass 0 or use invokeAction(Context).
See Also

public void invokeFooter (Context context)

Invoke the footer element of a card, this will start the target application or open the Play Store.

public void invokeFooter (Context context, int intentFlags)

Invoke the footer element of a card, this will start the target application or open the Play Store.

Parameters
intentFlags special intent intentFlags that will be used when starting the target application, most people will use invokePreview(Context)

public void invokeInventory (Context context, Inventory inventory)

Invoke an inventory item which will either open the target app for this item or start installation.

public void invokeInventory (Context context, Inventory inventory, int intentFlags)

Invoke an inventory item which will either open the target app for this item or start installation.

Parameters
intentFlags special intent intentFlags that will be used when starting the target application, most people will use invokePreview(Context)

public void invokePreview (Context context, int intentFlags)

This method is deprecated.
use #invokeAction(Context, intentFlags) instead.

Invoke the Preview (after a user clicked it) and show the appropriate card.

Parameters
intentFlags special intent intentFlags that will be used when starting the target application, most people will use invokePreview(Context)

public void invokePreview (Context context)

This method is deprecated.
use invokeAction(Context) instead.

Invoke the Preview (after a user clicked it) and show the appropriate card.

public String toString ()

public void trackButtonViewed (Context context)

Reporting views is important to measure the performance of your button. Make sure you call this method every time a button is shown to the user. Note: this is only to measure performance so make sure you report at the same interval across iOS and Android. We suggest that you report this right after you've configured your UI with the AppAction if those views will be visible.