BTNAppAction Class Reference
Inherits from | BTNModelObject |
---|---|
Declared in | BTNAppAction.h |
Overview
An App Action represents a button (i.e. “preview”) and inventory typically rendered as a “commerce card”.
Other Methods
meta
App action metadata (id, source token, expiry, etc).
@property (nullable, nonatomic, copy, readonly) BTNAppActionMeta *meta
Discussion
App action metadata (id, source token, expiry, etc).
Declared In
BTNAppAction.h
preview
The button preview data.
@property (nullable, nonatomic, copy, readonly) BTNPreview *preview
Discussion
The button preview data.
Declared In
BTNAppAction.h
header
Heading information for the inventory.
@property (nullable, nonatomic, strong, readonly) BTNHeader *header
Discussion
Heading information for the inventory.
Declared In
BTNAppAction.h
footer
Footer information for the inventory and default action.
@property (nullable, nonatomic, strong, readonly) BTNFooter *footer
Discussion
Footer information for the inventory and default action.
Declared In
BTNAppAction.h
Invoking Actions
– invokePreviewAction
- (void)invokePreviewAction
Discussion
Invokes the Button commerce card flow or a preview action if one exists.
Warning: Deprecated. Use invokeAction
instead.
Declared In
BTNAppAction.h
– invokeAction
Invokes the default action associated with this AppAction instance.
- (void)invokeAction
Discussion
Invokes the default action associated with this AppAction instance.
Call this method when you’re ready to invoke this action.
See Also
@c - invokeActionForListItem: If you’ve built out your own custom inventory UI.
@c - invokeActionWithCheckoutExtension: If you’re extending In-App Checkout (e.g. Button’s embedded browser).
Declared In
BTNAppAction.h
– invokeActionWithCheckoutExtension:
Invokes the default action associated with this AppAction instance.
- (void)invokeActionWithCheckoutExtension:(nonnull id<BTNCheckoutExtension>)checkoutExtension
Parameters
checkoutExtension |
Your object conforming to the checkout extension protocol. |
---|
Discussion
Invokes the default action associated with this AppAction instance.
Warning: Deprecated. Set your checkout extension via [Button setCheckoutExtension:]. Passing a checkout extension to this method will set/replace the checkout extension on Button.
Call this method when you’re ready to invoke this action.
Declared In
BTNAppAction.h
– invokeActionForListItem:
Invokes the action of a specific inventory list item.
- (void)invokeActionForListItem:(nonnull BTNListItem *)listItem
Discussion
Invokes the action of a specific inventory list item.
If you’ve built out your own custom inventory UI, call this method when a user taps a specific inventory item.
Note: Users will be sent to the destination application or through the Attended Install flow if the destination application is not installed.
Declared In
BTNAppAction.h
– invokeFooterAction
Invokes the footer action (i.e. default action).
- (void)invokeFooterAction
Discussion
Invokes the footer action (i.e. default action).
If your custom inventory UI includes BTNFooter data, call this method when you user taps on your custom footer view.
Note: Users will be sent to the destination application or through the Attended Install flow if the destination application is not installed.
Declared In
BTNAppAction.h
Fetching Preview Image
– fetchPreviewIconImageWithCompletion:
Fetches the preview icon image data from the preview
.iconImage.URL
or the local cache.
- (void)fetchPreviewIconImageWithCompletion:(nonnull void ( ^ ) ( UIImage *__nullable image ))completionHandler
Parameters
completionHandler |
A block to be executed once the image data has loaded. |
---|
Discussion
Fetches the preview icon image data from the preview
.iconImage.URL
or the local cache.
Note: The completionHandler takes one argument, a UIImage or nil if an error occurred.
Declared In
BTNAppAction.h
App Install State
– appInstallState
Determines whether the target app is installed, not installed or not queryable.
- (BTNAppInstallState)appInstallState
Return Value
BTNInstallStateNotInstalled if target application is NOT installed. BTNInstallStateInstalled if target application is installed. BTNInstallStateNotQueryable if app scheme was not declared in LSApplicationQueriesSchemes of Info.plist (>= iOS9).
Discussion
Determines whether the target app is installed, not installed or not queryable.
Declared In
BTNAppAction.h
Event Tracking
– trackButtonViewed
Tracks a “button viewed” event each time this method is called.
- (void)trackButtonViewed
Discussion
Tracks a “button viewed” event each time this method is called.
Note: Invoke this method when your custom button is displayed to the user.
Used 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.
Declared In
BTNAppAction.h