SCServiceCloud
@interface SCServiceCloud : NSObject
Shared singleton class used as the primary access point for the Snap-ins SDK.
Overview
This class gives you access to all the features of the SDK and allows you
to configure or customize the SDK. Use the +[SCServiceCloud sharedInstance]
class method to access the singleton for this class.
You can access each of the SDK features with properties on this singleton:
SCServiceCloud.knowledge
, SCServiceCloud.cases
, SCServiceCloud.chatUI
,
SCServiceCloud.sos
.
Specify your SCServiceCloudDelegate
implementation using the
SCServiceCloud.delegate
property. With this delegate, you can respond
to events and make decisions on behalf of the SDK.
Configuration & Customization
Specify the Knowledge and Case Management configuration settings using
the SCServiceCloud.serviceConfiguration
property.
Customize the appearance of the interface (such as the colors, fonts, images, and strings)
using the SCServiceCloud.appearanceConfiguration
property. To learn more about
SDK customizations, see Color Branding and
SDK Customizations in the Developer Guide.
Authentication & Notifications
Knowledge and Case Management both have an option to authenticate users so that users can access information related to their user account or their user profile. To learn more about authentication, see Authentication.
SCServiceCloud
allows you to explicitly set the authentication settings using
-setAuthenticationSettings:forServiceType:completion:
. You can also check the
authentication for a particular service using -authenticationSettingsForServiceType:
.
Refer to SCSAuthenticationSettings
for the core class associated with authentication.
Authenticated users can be notified using push notifications when there is activity on their cases. To learn more about notifications see Push Notifications for Case Activity.
SCServiceCloud
lets you determine whether the SDK can handle a remote push notification with
-notificationFromRemoteNotificationDictionary:
. If the notification
can be handled by the SDK, pass it to the -showInterfaceForNotification:
method.
Action Buttons
You can customize the action buttons used throughout the UI. You can override the look
and the behavior of existing buttons, and you can create buttons associated with new actions.
Use the SCServiceCloud.actions
property to get access to SCSActionManager
and the action button API.
-
Returns the shared service cloud manager for this process.
Declaration
Objective-C
+ (nonnull instancetype)sharedInstance;
Swift
class func shared() -> Self
Return Value
Initialized shared instace.
-
Directory URL where shared files will be stored on the filesystem. If
nil
, the system will supply the appropriate path given the application context. This value should be used if Snap-ins features will be accessible from multiple extensions within your application to ensure data is stored in a location accessible to all app extensions.Warning
NOTE This value must be set prior to the initialization of any system resources or classes utilizing Snap-ins features. The behavior is undefined if the value is changed after the fact.Declaration
Objective-C
@property (class, nonatomic, copy, nullable) NSURL *sharedDataDirectory;
Swift
class var sharedDataDirectory: URL? { get set }
-
Identifies the primary window where view controllers should be placed when presented.
This value is automatically determined under most circumstances, but in the event that a custom value needs to be set, the
primaryWindow
property can be set to a specific window that should be used.Declaration
Objective-C
@property (nonatomic, strong, nullable) UIWindow *primaryWindow;
Swift
var primaryWindow: UIWindow? { get set }
-
The delegate for the service interface manager.
Declaration
Objective-C
@property (nonatomic, weak, nullable) NSObject<SCServiceCloudDelegate> *delegate;
Swift
weak var delegate: SCServiceCloudDelegate? { get set }
-
The appearance style to use in presented views and view controllers.
The default value for this is
SCInterfaceStyleDefault
. If this value is set after the interface has already been presented, it results in the service interface being dismissed.Warning
We recommend that you only assign this property once in the lifetime of an application. Changing interface styles at runtime may have unpredictable results, and the behavior is undefined.Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull interfaceStyle;
Swift
var interfaceStyle: String { get set }
-
Sets the appearance configuration for the service interface. If not specified, this value falls back to default values.
Declaration
Objective-C
@property (nonatomic, strong) SCAppearanceConfiguration *_Nonnull appearanceConfiguration;
Swift
var appearanceConfiguration: SCAppearanceConfiguration { get set }
-
Configuration object used to define the self-service parameters used to enable with Cases and/or Knowledge features.
Declaration
Objective-C
@property (nonatomic, strong) SCSServiceConfiguration *_Nonnull serviceConfiguration;
Swift
var serviceConfiguration: SCSServiceConfiguration { get set }
-
The singleton instance for Case Management.
See
SCCaseInterface
Declaration
Objective-C
@property (nonatomic, strong, readonly) SCCaseInterface *cases;
Swift
var cases: SCCaseInterface! { get }
-
The singleton instance of the chat core interface. For access to the chat user interface, see
SCServiceCloud.chatUI
.See
SCSChat
-
The singleton instance of the chat user interface. For access to the chat core interface, see
SCServiceCloud.chatCore
.See
SCSChatInterface
Declaration
Objective-C
@property (nonatomic, strong, readonly) SCSChatInterface *chatUI;
Swift
var chatUI: SCSChatInterface! { get }
-
Specifies the authentication settings for the designated service.
The service can be one of the
SCServiceType
enum values:SCServiceTypeCases
: for the Case Management serviceSCServiceTypeKnowledge
: for the Knowledge service
Declaration
Objective-C
- (void)setAuthenticationSettings:(nullable SCSAuthenticationSettings *)settings forServiceType:(nonnull SCServiceType)serviceType completion: (nullable void (^)( BOOL, NSError *_Nullable __strong))completion;
Swift
func setAuthenticationSettings(_ settings: SCSAuthenticationSettings?, forServiceType serviceType: SCServiceType) async throws -> Bool
Parameters
settings
Authentication settings for this service.
serviceType
The designated service.
completion
The completion block that is called after the SDK attempts to authenticate.
-
Returns the authentication settings for the designated service type.
The service can be one of the
SCServiceType
enum values:SCServiceTypeCases
: for the Case Management serviceSCServiceTypeKnowledge
: for the Knowledge service
Declaration
Objective-C
- (nullable SCSAuthenticationSettings *)authenticationSettingsForServiceType: (nonnull SCServiceType)serviceType;
Swift
func authenticationSettings(forServiceType serviceType: SCServiceType) -> SCSAuthenticationSettings?
Parameters
serviceType
The designated service.
-
Returns a concrete subclass of
SCSNotification
from a remote notification dictionary.Returns
nil
if the notification cannot be handled by the SDK. Use-showInterfaceForNotification:
to show the view associated with this notification.Declaration
Objective-C
- (nullable SCSNotification *)notificationFromRemoteNotificationDictionary: (nonnull NSDictionary *)userInfo;
Swift
func notification(fromRemoteNotificationDictionary userInfo: [AnyHashable : Any]) -> SCSNotification?
Parameters
userInfo
The remote notification dictionary.
-
Shows the appropriate view related to the notification that is passed to this method.
Use
-notificationFromRemoteNotificationDictionary:
to convert anNSDictionary
into anSCSNotification
object.Declaration
Objective-C
- (BOOL)showInterfaceForNotification:(nonnull SCSNotification *)notification;
Swift
func showInterface(for notification: SCSNotification) -> Bool
Parameters
notification
The notification that determines what interface to show.
-
Access point for interacting with the floating action bar.
See
SCSActionManager
Declaration
Objective-C
@property (nonatomic, strong, readonly) SCSActionManager *_Nonnull actions;
Swift
var actions: SCSActionManager { get }
-
The singleton instance for Knowledge.
Declaration
Objective-C
@property (nonatomic, strong, readonly) SCKnowledgeInterface *knowledge;
Swift
var knowledge: SCKnowledgeInterface! { get }