SCServiceCloudDelegate Protocol Reference

Conforms to NSObject
Declared in SCServiceCloudDelegate.h

Overview

Delegate protocol to interact with the Service SDK, and to make decisions on behalf of the SDK.

– serviceCloud:willDisplayViewController:animated:

Tells the delegate when the interface is about to be displayed.

- (void)serviceCloud:(SCServiceCloud *)serviceCloud willDisplayViewController:(nullable UIViewController *)controller animated:(BOOL)animated

Parameters

serviceCloud

SCServiceCloud interface instance.

controller

View controller being displayed.

animated

YES if the presentation is animated.

Discussion

If the controller is nil, this means no more controllers remain visible.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:didDisplayViewController:animated:

Calls the delegate after the interface was displayed.

- (void)serviceCloud:(SCServiceCloud *)serviceCloud didDisplayViewController:(nullable UIViewController *)controller animated:(BOOL)animated

Parameters

serviceCloud

SCServiceCloud interface instance.

controller

View controller being displayed.

animated

YES if the presentation was animated.

Discussion

If the controller is nil, this means no more controllers remain visible.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:transitioningDelegateForViewController:

Asks the delegate to provide a UIViewControllerTransitioningDelegate used when a view controller is about to be presented.

- (nullable NSObject<UIViewControllerTransitioningDelegate> *)serviceCloud:(SCServiceCloud *)serviceCloud transitioningDelegateForViewController:(UIViewController *)controller

Parameters

serviceCloud

SCServiceCloud interface instance.

controller

View controller about to be presented.

Return Value

Transitioning delegate that should control the controller presentation, or nil to accept the system defaults.

Discussion

By default, the SDK uses custom controllers for presentation and for transition animations. If you wish to customize the default behavior, implement this method and return an object conforming to UIViewControllerTransitioningDelegate.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:transitioningDelegateForPresentedController:presentingController:

Asks the delegate to provide a UIViewControllerTransitioningDelegate used when a view controller is about to be presented.

- (nullable NSObject<UIViewControllerTransitioningDelegate> *)serviceCloud:(SCServiceCloud *)serviceCloud transitioningDelegateForPresentedController:(UIViewController *)presentedController presentingController:(nullable UIViewController *)presentingController

Parameters

serviceCloud

SCServiceCloud interface instance.

presentedController

View controller about to be presented.

presentingController

View controller the target controller is being presented from. If this value is nil, it is assumed to be the first controller being presented at the time.

Return Value

Transitioning delegate that should control the controller presentation, or nil to accept the system defaults.

Discussion

By default, the SDK uses custom controllers for presentation and for transition animations. If you wish to customize the default behavior, implement this method and return an object conforming to UIViewControllerTransitioningDelegate.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:shouldShowActionWithName:

Asks the delegate whether the specified action button should be present.

- (BOOL)serviceCloud:(SCServiceCloud *)serviceCloud shouldShowActionWithName:(NSString *)name

Parameters

serviceCloud

SCServiceCloud interface instance.

name

Name representing the action in question.

Return Value

YES if the action button should be visible; NO if the action button should be omitted.

Discussion

The value of the action name can be one of these constants (defined in Service SDK):

  • SCSActionCasePublisher: for the case publisher action
  • SCSActionCaseList: for the case list action
  • SCSActionArticleSearch: for the knowledge article search action

Declared In

SCServiceCloudDelegate.h

– serviceCloud:shouldAuthenticateService:completion:

Asks the delegate whether authentication should be performed for the specified service.

- (BOOL)serviceCloud:(SCServiceCloud *)serviceCloud shouldAuthenticateService:(SCServiceType)service completion:(void ( ^ ) ( SFUserAccount *_Nullable account ))completion

Parameters

serviceCloud

SCServiceCloud interface instance.

service

The associated service.

completion

The completion block you should call when you’ve retrieved the user account.

Return Value

YES if the receiver plans to supply authentication information for this service, otherwise NO if the current account credentials are sufficient.

Discussion

The value of the service name can be one of these constants (defined in Service SDK):

  • SCServiceTypeCases: for the Case Management service
  • SCServiceTypeKnowledge: for the Knowledge service

If the delegate returns YES to this method, it is the responsibility of the receiver to supply the new user account object to the supplied completion block. The value supplied to the completion block will replace the SCServiceCloud.account property.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:serviceAuthenticationFailedWithError:

Tells the delegate when there is an error in authenticating Case Management or Knowledge.

- (void)serviceCloud:(SCServiceCloud *)serviceCloud serviceAuthenticationFailedWithError:(NSError *)error

Parameters

serviceCloud

SCServiceCloud interface instance.

error

The error message associated with the failure.

Declared In

SCServiceCloudDelegate.h

– serviceCloud:didLogMessage:type:

Tells the delegate when there is a log message that has been sent to the logging server.

- (void)serviceCloud:(SCServiceCloud *)serviceCloud didLogMessage:(NSArray *_Nonnull)message type:(NSString *_Nonnull)type

Parameters

serviceCloud

SCServiceCloud interface instance.

message

An array containing all the logging information.

type

The type of message that is being logged.

Declared In

SCServiceCloudDelegate.h