SCSActionManager Class Reference

Inherits from NSObject
Declared in SCSActionManager.h

Overview

The SCSActionManager class controls the handling and display of the action buttons that are overlaid on the various Snap-ins SDK interface elements to allow the user to initiate various actions, such as:

  • Creating a new case.
  • Initiating a knowledge article search.
  • Starting a Live Agent chat session.
  • Initiating an SOS support session.

These built-in actions are managed through the action manager class, and can be customized through the use of it and the associated protocols available. Furthermore, the SCSActionManagerDelegate protocol can be used to interact with, and customize, the handling of these actions.

Each action button that is displayed is represented by UIView instances that conform to the SCSActionItem protocol. Each of these items are displayed within a UIViewController instance that conforms to the SCSActionItemController protocol. Built-in defaults are provided that implement these behaviors, and can be used to extend or customize functionality. Furthermore, the default action button is exposed as the SCSActionButton class, and can be used to introduce additional actions along side the built-in defaults, while still maintaining the same visual appearance.

  delegate

Delegate property for interacting with, and customizing, the action manager.

@property (nonatomic, weak) NSObject<SCSActionManagerDelegate> *delegate

Declared In

SCSActionManager.h

– setNeedsUpdateActionItems

Indicates that the set of available action items may have changed, and informs the SCSActionManager that it should reevaluate its set of available options.

- (void)setNeedsUpdateActionItems

Declared In

SCSActionManager.h

  actionItemContainer

Reference to the current action display controller.

@property (nullable, nonatomic, strong, readonly) UIViewController<SCSActionItemContainer> *actionItemContainer

Declared In

SCSActionManager.h

  containerVisible

Indicates whether or not the action item container is visible.

@property (nonatomic, assign, getter=isContainerVisible) BOOL containerVisible

Discussion

Under normal circumstances the action container will automatically show and hide based on whether or not the current display supports it. This behavior can be extended or customized within the [SCSActionManagerDelegate actionManager:shouldShowContainerForViewController:] delegate method. When all remaining ServiceSDK UI elements have been dismissed, the action container will automatically be cleaned up and removed from the view hierarchy. However, if the containerVisible property is set directly, this default behavior is opted out, allowing the container to remain visible after the ServiceSDK elements have been dismissed.

See Also

  • [SCSActionManager setContainerVisible:animated:]

Declared In

SCSActionManager.h

– setContainerVisible:animated:

Animated setter for controlling the action item container visibility.

- (void)setContainerVisible:(BOOL)visible animated:(BOOL)animated

Parameters

visible

YES if the action container should be visible, or NO to make the container hidden.

animated

Indicates whether or not the container visibility change should be animated.

Declared In

SCSActionManager.h

– isActionItemWithNameVisible:NS_SWIFT_NAME:

Indicates whether or not an action with the given name is currently visible.

- (BOOL)isActionItemWithNameVisible:(SCSAction)actionName NS_SWIFT_NAME

Parameters

actionName

Action name.

Return Value

YES if the action is visible.

Declared In

SCSActionManager.h

– setActionItemWithName:visible:animated:NS_SWIFT_NAME:

Shows or hides an action with the given name.

- (void)setActionItemWithName:(SCSAction)name visible:(BOOL)visible animated:(BOOL)animated NS_SWIFT_NAME

Parameters

name

Action name.

visible

YES If the action should be visible, or NO if the action should be hidden.

animated

YES If the action’s view should be animated.

Discussion

If the [SCServiceCloudDelegate serviceCloud:shouldShowActionWithName:] delegate method is implemented, the result of that method is respected regardless of which value is supplied to this method.

Declared In

SCSActionManager.h

– performActionWithName:actionItem:NS_SWIFT_NAME:

Performs the action associated with the action name for the supplied action item.

- (void)performActionWithName:(SCSAction)actionName actionItem:(nullable UIView<SCSActionItem> *)actionItem NS_SWIFT_NAME

Parameters

actionName

Name of the action to perform.

actionItem

Action item for which the action needs to be performed.

Declared In

SCSActionManager.h