AVAMessageAction

Objective-C

@interface AVAMessageAction : NSObject

Swift

class AVAMessageAction : NSObject

@abstract An action associated to a particular AVAMessage.

Actions are rendered as buttons in the AvMessagingSdk conversation screen, and may be of type AVAMessageActionTypeLink, AVAMessageActionTypeBuy or AVAMessageActionTypePostback.

See

AVAMessage
  • @abstract The unique identifier representing the action.

    Declaration

    Objective-C

    @property (readonly, nullable) NSString *actionId;

    Swift

    var actionId: String? { get }
  • @abstract The type of action.

    @discussion Valid types include AVAMessageActionTypeLink for regular actions, and AVAMessageActionTypeBuy for buy actions.

    Declaration

    Objective-C

    @property (nullable) NSString *type;

    Swift

    var type: String? { get set }
  • @abstract The text to display as a descriptor for the action.

    @discussion May not be nil.

    Declaration

    Objective-C

    @property (nullable) NSString *text;

    Swift

    var text: String? { get set }
  • uri

    @abstract The URI to navigate to if the user interacts with the action.

    @discussion May not be nil if message is of type AVAMessageActionTypeLink or AVAMessageActionTypeWebview

    Declaration

    Objective-C

    @property (nullable) NSURL *uri;

    Swift

    var uri: URL? { get set }
  • @abstract Fallback URI to use for action types not supported by the SDK. May be nil.

    Declaration

    Objective-C

    @property (nullable) NSURL *fallback;

    Swift

    var fallback: URL? { get set }
  • @abstract The size of a webview

    @discussion May not be nil if message is of type AVAMessageActionTypeWebview

    Declaration

    Objective-C

    @property (copy, nullable) NSString *size;

    Swift

    var size: String? { get set }
  • @abstract Boolean value indicating whether this action is the default action for an AVAMessageItem

    @discussion Default value is NO

    See

    AVAMessageItem

    Declaration

    Objective-C

    @property (readonly) BOOL isDefault;

    Swift

    var isDefault: Bool { get }
  • @abstract Metadata associated with the action.

    @discussion A flat dictionary of metadata set through the REST API. May be nil.

    Declaration

    Objective-C

    @property (nullable) NSDictionary *metadata;

    Swift

    var metadata: [AnyHashable : Any]? { get set }
  • @abstract Icon to display with a reply

    @discussion An icon to render next to the reply option

    Declaration

    Objective-C

    @property (nullable) NSString *iconUrl;

    Swift

    var iconUrl: String? { get set }
  • @abstract The payload of actions with type AVAMessageActionTypeReply or AVAMessageActionTypePostback

    @discussion The payload of actions with type AVAMessageActionTypeReply or AVAMessageActionTypePostback, if applicable. May be nil

    Declaration

    Objective-C

    @property (nullable) NSString *payload;

    Swift

    var payload: String? { get set }

Buy actions

  • @abstract The purchase state of the action

    @discussion This property is only non-nil for actions of type AVAMessageActionTypeBuy. Valid states include AVAMessageActionStateOffered and AVAMessageActionStatePaid.

    Declaration

    Objective-C

    @property (nullable) NSString *state;

    Swift

    var state: String? { get set }
  • @abstract The amount of money to charge for the action.

    @discussion This property is only valid for actions of type AVAMessageActionTypeBuy. For USD, this value is in cents.

    Declaration

    Objective-C

    @property long amount;

    Swift

    var amount: Int { get set }
  • @abstract The currency in which the amount is expressed.

    @discussion This property is only valid for actions of type AVAMessageActionTypeBuy.

    Declaration

    Objective-C

    @property (nullable) NSString *currency;

    Swift

    var currency: String? { get set }