SCServiceCloudDelegate

@protocol SCServiceCloudDelegate <NSObject>

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

  • 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

    serviceCloud

    SCServiceCloud interface instance.

    controller

    View controller being displayed.

    animated

    YES if 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

    serviceCloud

    SCServiceCloud interface instance.

    controller

    View controller being displayed.

    animated

    YES if the presentation was animated.

  • Asks the delegate to provide a UIViewControllerTransitioningDelegate used 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

    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.

  • Asks the delegate to provide a UIViewControllerTransitioningDelegate used 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

    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.

  • 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):

    Declaration

    Objective-C

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

    Swift

    optional func serviceCloud(_ serviceCloud: SCServiceCloud, shouldShowActionWithName name: String) -> Bool

    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.

  • 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
  • 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 SCServiceType enum values:

    If the delegate returns YES to 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) -> Bool

    Parameters

    serviceCloud

    SCServiceCloud interface instance.

    service

    The associated service.

    completion

    The completion block you should call when you’ve retrieved authentication credentials. If nil is assigned to the completion block, it is assumed that guest access is desired.

    Return Value

    YES if the receiver plans to supply authentication information for this service, otherwise NO if 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) -> Bool

    Parameters

    serviceCloud

    SCServiceCloud interface instance.

    error

    The error message associated with the failure.

    service

    Service 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 specify NO, 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

    serviceCloud

    SCServiceCloud interface instance.

    message

    An array containing all the logging information.

    type

    The type of message that is being logged.