# 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

- `actionId`

  @abstract The unique identifier representing the action.

  #### Declaration

  Objective-C

      @property (readonly, nullable) NSString *actionId;

  Swift

      var actionId: String? { get }

- `type`

  @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 }

- `text`

  @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 }

- `fallback`

  @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 }

- `size`

  @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 }

- `isDefault`

  @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 }

- `metadata`

  @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 }

- `iconUrl`

  @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 }

- `payload`

  @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

- `state`

  @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 }

- `amount`

  @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 }

- `currency`

  @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 }

© 2022 . All rights reserved. (Last updated: 2022-06-30)

Generated by jazzy ♪♫ v0.14.2, a Realm project.