SCServiceCloudDelegate
@protocol SCServiceCloudDelegate <NSObject>
Delegate protocol to interact with the Service SDK, and to make decisions on behalf of the SDK.
See
SCServiceCloud
-
Tells the delegate when the interface is about to be displayed.
If the controller is
nil, this means no more controllers remain visible.Declaration
Objective-C
- (void)serviceCloud:(nonnull SCServiceCloud *)serviceCloud willDisplayViewController:(nullable UIViewController *)controller animated:(BOOL)animated;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, willDisplay controller: UIViewController?, animated: Bool)Parameters
serviceCloudSCServiceCloudinterface instance.controllerView controller being displayed.
animatedYESif the presentation is animated. -
Calls the delegate after the interface was displayed.
If the controller is
nil, this means no more controllers remain visible.Declaration
Objective-C
- (void)serviceCloud:(nonnull SCServiceCloud *)serviceCloud didDisplayViewController:(nullable UIViewController *)controller animated:(BOOL)animated;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, didDisplay controller: UIViewController?, animated: Bool)Parameters
serviceCloudSCServiceCloudinterface instance.controllerView controller being displayed.
animatedYESif the presentation was animated. -
Asks the delegate to provide a
UIViewControllerTransitioningDelegateused when a view controller is about to be presented.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.Declaration
Objective-C
- (nullable NSObject<UIViewControllerTransitioningDelegate> *) serviceCloud: (nonnull SCServiceCloud *)serviceCloud transitioningDelegateForViewController: (nonnull UIViewController *)controller;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, transitioningDelegateFor controller: UIViewController) -> UIViewControllerTransitioningDelegate?Parameters
serviceCloudSCServiceCloudinterface instance.controllerView controller about to be presented.
Return Value
Transitioning delegate that should control the controller presentation, or
nilto accept the system defaults. -
Asks the delegate to provide a
UIViewControllerTransitioningDelegateused when a view controller is about to be presented.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.Declaration
Objective-C
- (nullable NSObject<UIViewControllerTransitioningDelegate> *) serviceCloud: (nonnull SCServiceCloud *)serviceCloud transitioningDelegateForPresentedController: (nonnull UIViewController *)presentedController presentingController:(nullable UIViewController *) presentingController;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, transitioningDelegateForPresentedController presentedController: UIViewController, presenting presentingController: UIViewController?) -> UIViewControllerTransitioningDelegate?Parameters
serviceCloudSCServiceCloudinterface instance.presentedControllerView controller about to be presented.
presentingControllerView 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
nilto accept the system defaults. -
Asks the delegate whether the specified action button should be present.
The value of the action name can be one of these constants (defined in Service SDK):
SCSActionCasePublisher: for the case publisher actionSCSActionCaseList: for the case list actionSCSActionArticleSearch: for the knowledge article search action
Declaration
Objective-C
- (BOOL)serviceCloud:(nonnull SCServiceCloud *)serviceCloud shouldShowActionWithName:(nonnull NSString *)name;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, shouldShowActionWithName name: String) -> BoolParameters
serviceCloudSCServiceCloudinterface instance.nameName representing the action in question.
Return Value
YESif the action button should be visible;NOif the action button should be omitted. -
Deprecated. See
-serviceCloud:shouldAuthenticateServiceType:completion:.Declaration
Objective-C
- (BOOL)serviceCloud:(nonnull SCServiceCloud *)serviceCloud shouldAuthenticateService:(nonnull SCServiceType)service completion:(nonnull void (^)( SFUserAccount *_Nullable __strong))completion;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, shouldAuthenticateService service: SCServiceType, completion: @escaping (SFUserAccount?) -> Void) -> Bool -
Deprecated. See
-serviceCloud:authenticationFailed:forServiceType:.Declaration
Objective-C
- (void)serviceCloud:(nonnull SCServiceCloud *)serviceCloud serviceAuthenticationFailedWithError:(nonnull NSError *)error;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, serviceAuthenticationFailedWithError error: Error) -
Asks the delegate whether authentication should be performed for the specified service.
The service can be one of the
SCServiceTypeenum values:SCServiceTypeCases: for the Case Management serviceSCServiceTypeKnowledge: for the Knowledge service
If the delegate returns
YESto this method, the receiver must pass along the new authentication settings to the supplied completion block. These authentication settings are subsequently passed along to the-[SCServiceCloud setAuthenticationSettings:forServiceType:completion:]method.Declaration
Objective-C
- (BOOL)serviceCloud:(nonnull SCServiceCloud *)serviceCloud shouldAuthenticateServiceType:(nonnull SCServiceType)service completion: (nonnull void (^)( SCSAuthenticationSettings *_Nullable __strong)) completion;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, shouldAuthenticateServiceType service: SCServiceType, completion: @escaping (SCSAuthenticationSettings?) -> Void) -> BoolParameters
serviceCloudSCServiceCloudinterface instance.serviceThe associated service.
completionThe completion block you should call when you’ve retrieved authentication credentials. If
nilis assigned to the completion block, it is assumed that guest access is desired.Return Value
YESif the receiver plans to supply authentication information for this service, otherwiseNOif the current account credentials are sufficient. -
Tells the delegate when there is an error in authenticating Case Management or Knowledge.
Declaration
Objective-C
- (BOOL)serviceCloud:(nonnull SCServiceCloud *)serviceCloud authenticationFailed:(nonnull NSError *)error forServiceType:(nonnull SCServiceType)service;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, authenticationFailed error: Error, forServiceType service: SCServiceType) -> BoolParameters
serviceCloudSCServiceCloudinterface instance.errorThe error message associated with the failure.
serviceService being authenticated.
Return Value
Whether the receiver wants to attempt to re-authenticate. If you specify
YES, the SDK subsequently calls-serviceCloud:shouldAuthenticateServiceType:completion:. If you specifyNO, the SDK reverts to guest user status. -
Tells the delegate when there is a log message that has been sent to the logging server.
Declaration
Objective-C
- (void)serviceCloud:(nonnull SCServiceCloud *)serviceCloud didLogMessage:(NSArray *_Nonnull)message type:(NSString *_Nonnull)type;Swift
optional func serviceCloud(_ serviceCloud: SCServiceCloud, didLogMessage message: [Any], type: String)Parameters
serviceCloudSCServiceCloudinterface instance.messageAn array containing all the logging information.
typeThe type of message that is being logged.
Install in Dash
SCServiceCloudDelegate Protocol Reference