SCSCasePublisherViewControllerDelegate

@protocol SCSCasePublisherViewControllerDelegate <NSObject>

Delegate protocol used to receive events about the actions performed by the case publisher view controller.

  • Tells the delegate when the case is submitted. If the submission failed, this method passes the error to the delegate.

    Declaration

    Objective-C

    - (void)casePublisher:(nonnull SCSCasePublisherViewController *)publisher
        didSubmitWithResult:(SCSCasePublisherResult)result
                 withCaseId:(nullable NSString *)caseId
                      error:(nullable NSError *)error;

    Swift

    optional func casePublisher(_ publisher: SCSCasePublisherViewController, didSubmitWith result: SCSCasePublisherResult, withCaseId caseId: String?, error: Error?)

    Parameters

    publisher

    Case publisher controller sending the message.

    result

    Result of the user’s action.

    caseId

    ID of the created case if one was created, and if the ID can be determined.

    error

    Error returned, if any.

  • Allows the delegate to hide some of the case fields from showing in the Case Publisher.

    Declaration

    Objective-C

    - (nonnull NSSet<NSString *> *)
                     casePublisher:
                         (nonnull SCSCasePublisherViewController *)publisher
        fieldsToHideFromCaseFields:(nonnull NSArray<NSString *> *)availableFields;

    Swift

    optional func casePublisher(_ publisher: SCSCasePublisherViewController, fieldsToHideFromCaseFields availableFields: [String]) -> Set<String>

    Parameters

    publisher

    Case publisher controller sending the message.

    availableFields

    List of fields in the Case Publisher layout.

    Return Value

    Set of fields to be hidden in the Case Publisher.

  • Allows the delegate to pass in the case field values while submitting the case.

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)
                casePublisher:(nonnull SCSCasePublisherViewController *)publisher
        valuesForHiddenFields:(nonnull NSSet<NSString *> *)hiddenFields;

    Swift

    optional func casePublisher(_ publisher: SCSCasePublisherViewController, valuesForHiddenFields hiddenFields: Set<String>) -> [String : Any]

    Parameters

    publisher

    Case publisher controller sending the message.

    hiddenFields

    Set of hidden fields in the Case Publisher.

    Return Value

    NSDictionary in which each entry maps the field name to the field value to be used during case submission.

  • Allows the delegate to supply a custom view to display to the user when the provided result is reached.

    If this method is not implemented, or the result is nil, the case publisher will automatically provide a default value. The returned view will be sized as needed to fit the available space on the case publisher.

    Declaration

    Objective-C

    - (nullable UIView *)casePublisher:
                             (nonnull SCSCasePublisherViewController *)publisher
                         viewForResult:(SCSCasePublisherResult)result
                            withCaseId:(nullable NSString *)caseId
                                 error:(nullable NSError *)error;

    Swift

    optional func casePublisher(_ publisher: SCSCasePublisherViewController, viewFor result: SCSCasePublisherResult, withCaseId caseId: String?, error: Error?) -> UIView?

    Parameters

    publisher

    Case publisher controller sending the message.

    result

    Result of the case publisher.

    caseId

    ID of the created case if one was created, and if the ID can be determined.

    error

    Error returned, if any.

    Return Value

    UIView instance configured for showing the result to the user, or nil if the default should be used.

  • Allows the delegate to disable the case deflection feature in the Case Publisher. By default the case deflection is enabled.

    Declaration

    Objective-C

    - (BOOL)shouldEnableCaseDeflectionForPublisher:
        (nonnull SCSCasePublisherViewController *)publisher;

    Swift

    optional func shouldEnableCaseDeflection(forPublisher publisher: SCSCasePublisherViewController) -> Bool

    Parameters

    publisher

    Case publisher controller sending the message.

    Return Value

    YES if the case publisher should display case deflection articles.

  • Allows the delegate to specify the case fields for which case deflection articles are displayed.

    Declaration

    Objective-C

    - (nonnull NSSet<NSString *> *)
                  casePublisher:(nonnull SCSCasePublisherViewController *)publisher
        fieldsForCaseDeflection:(nonnull NSArray<NSString *> *)availableFields;

    Swift

    optional func casePublisher(_ publisher: SCSCasePublisherViewController, fieldsForCaseDeflection availableFields: [String]) -> Set<String>

    Parameters

    publisher

    Case publisher controller sending the message.

    availableFields

    List of editable text or textarea fields in the Case Publisher layout.

    Return Value

    Set of fields to be used for forming case deflection searchterm.