Knowledge

This is a list of classes related to Knowledge. The entry point into this feature is through the SCKnowledgeInterface class. Refer to that class to get started.

  • The SCKnowledgeInterface class is the main interface to the Knowledge SDK. Use this class to configure and customize the Knowledge interface.

    To get an instance of this class, use the SCServiceCloud.knowledge property on +[SCServiceCloud sharedInstance].

    See more

    Declaration

    Objective-C

    @interface SCKnowledgeInterface : NSObject

    Swift

    class SCKnowledgeInterface : NSObject
  • Delegate protocol that defines the methods sent to the Knowledge delegate.

    See more

    Declaration

    Objective-C

    @protocol SCKnowledgeInterfaceDelegate <NSObject>

    Swift

    protocol SCKnowledgeInterfaceDelegate : NSObjectProtocol
  • A SCSKnowledgeManager object is used to interact with knowledge data such as category groups, categories, and articles.

    The knowledge manager abstracts the storage, network retrieval, and queries for interacting with data in an efficient fashion. You can use this object to fetch categories and articles from your org. Once fetched, you can use this object to get cached content. See the SCSArticleQuery class for an explanation on how to query for content.

    The knowledge manager caches data for offline use, allowing categories and articles to be used even when no network is available. To stay informed about important changes in the underlying data model, any changes to the underlying categories will be advertised through the use of the following notifications:

    The object of the notification will be the SCSKnowledgeManager instance itself, while the category in question is stored in the notification’s userInfo dictionary under the SCSKnowledgeManagerCategoryKey key.

    See more

    Declaration

    Objective-C

    
    @interface SCSKnowledgeManager : NSObject

    Swift

    class KnowledgeManager : NSObject
  • Field to sort articles by.

    See more

    Declaration

    Objective-C

    enum SCArticleSortByField : NSInteger {}

    Swift

    enum SCArticleSortByField : Int
  • Article sort order.

    See more

    Declaration

    Objective-C

    enum SCArticleSortOrder : NSInteger {}

    Swift

    enum SCArticleSortOrder : Int
  • Knowledge channel type.

    See more

    Declaration

    Objective-C

    enum SCChannelType : NSInteger {}

    Swift

    enum SCChannelType : Int
  • Knowledge article query method.

    See more

    Declaration

    Objective-C

    enum SCQueryMethod : NSInteger {}

    Swift

    enum SCQueryMethod : Int
  • A SCSArticle object represents a knowledge base article.

    This article may or may not already be downloaded locally. Use the -[SCSArticle isArticleContentDownloaded] property to check whether it is downloaded. You can download the article with the -[SCSArticle downloadContentWithOptions:completion:] method.

    See more

    Declaration

    Objective-C

    
    @interface SCSArticle : NSObject

    Swift

    class Article : NSObject
  • Download options used when fetching article content.

    See more

    Declaration

    Objective-C

    enum SCSArticleDownloadOption : NSInteger {}

    Swift

    enum SCSArticleDownloadOption : Int
  • View controller capable of displaying the contents of an article. When used in conjunction with a navigation controller, the title property of the view will automatically be set to the title of the article, or nil if no article is assigned.

    Article content is automatically rendered into content capable of being displayed within this view controller. The articles data is laid out as HTML and rendered within a WKWebView instance.

    HTML content is rendered using a structure like the following:

    <html>
     <head>
       <meta name="viewport" content="initial-scale=1"/>
       <link rel="stylesheet" href="/style.css" type="text/css" media="all"/>
       <link rel="stylesheet" href="/article/{{article.id}}/style.css" type="text/css" media="all"/>
     </head>
     <body>
       <header>
         {{article.title}}
       </header>
       <main>
         <field name="{{field.name}}" type="{{field.type}}">
           <field-title>{{field.title}}</field-title>
           <field-value>{{field.value}}</field-value>
         </field>
         ...
       </main>
       <script src="/script.js"></script>
       <script src="/article/{{article.id}}/script.js"></script>
     </body>
    

    Smart link tags (anchors referencing other articles within Salesforce) will be decorated with a “smart-link” CSS class, which can be used to style those links differently as needed.

    Each article field is separated into its own block which can be independently formatted, hidden, or otherwise styled using custom CSS. The default global CSS is automatically populated based on the fonts and colors defined in SCAppearanceConfiguration. Furthermore, if any custom styles need to be changed, SCAppearanceConfiguration.globalArticleCSS property can be used to add default syles that are applied to all articles. Likewise, the SCAppearanceConfiguration.globalArticleJavascript property can be used to supply common javascript to be injected to all articles when they’re loaded.

    The -[SCSArticleViewControllerDelegate articleController:additionalCSSForArticle:] and -[SCSArticleViewControllerDelegate articleController:additionalJavascriptForArticle:] delegate methods can be used to provide more granular per-article control over both CSS and javascript.

    See more

    Declaration

    Objective-C

    @interface SCSArticleViewController : UIViewController

    Swift

    class SCSArticleViewController : UIViewController
  • Delegate protocol used to interact with article view controllers.

    See more

    Declaration

    Objective-C

    @protocol SCSArticleViewControllerDelegate <NSObject>

    Swift

    protocol SCSArticleViewControllerDelegate : NSObjectProtocol
  • An SCSArticleQuery object manages the criteria to apply when fetching and searching knowledge articles. This query object stores the type of search, the search parameters, and any filters or constraints to apply when searching.

    This class is immutable. To create a mutable query object, see SCSMutableArticleQuery.

    See more

    Declaration

    Objective-C

    
    @interface SCSArticleQuery : NSObject <NSCopying, NSMutableCopying>

    Swift

    class ArticleQuery : NSObject, NSCopying, NSMutableCopying
  • View controller capable of showing the list of articles that are the result of a query.

    See more

    Declaration

    Objective-C

    @interface SCSArticleQueryListViewController : SCSCategoryViewController

    Swift

    class SCSArticleQueryListViewController : SCSCategoryViewController
  • Delegate protocol to allow the receiver to interact with, and control the experience of, a category view controller.

    See more

    Declaration

    Objective-C

    @protocol SCSArticleQueryListViewControllerDelegate <
        SCSCategoryViewControllerDelegate>

    Swift

    protocol SCSArticleQueryListViewControllerDelegate : SCSCategoryViewControllerDelegate
  • This class is intended to efficiently manage the results of an article query to return an indexed list of articles to the caller.

    You configure an instance of this controller with a specific query, and the fetches and pagination will automatically be handled for you. Any changes to the set of articles will be communicated through the use of the SCSArticleQueryResultsControllerDelegate, allowing UI state to be updated as needed.

    See more

    Declaration

    Objective-C

    @interface SCSArticleQueryResultsController : NSObject

    Swift

    class SCSArticleQueryResultsController : NSObject
  • Delegate protocol for interacting with a SCSArticleQueryResultsController.

    See more

    Declaration

    Objective-C

    @protocol SCSArticleQueryResultsControllerDelegate <NSObject>

    Swift

    protocol SCSArticleQueryResultsControllerDelegate : NSObjectProtocol
  • A SCSCategory represents an individual data category within a data category group. Categories form a tree hierarchy, where an individual category has one parent category (with the exception of a root-level category, which does not have a parent), and it may have multiple child categories.

    Refer to SCSCategoryGroup for a representation of a data category group.

    See more

    Declaration

    Objective-C

    
    @interface SCSCategory : NSObject

    Swift

    class Category : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    NS_ENUM(NSInteger, SCSCategoryDisplayMode) {
        SCSCategoryDisplayModeArticlesOnly,
        SCSCategoryDisplayModeArticlesAndCategories
    }

    Swift

    enum SCSCategoryDisplayMode : Int
  • Undocumented

    See more

    Declaration

    Objective-C

    NS_ENUM(NSInteger, SCSCategoryHeaderType) {
        SCSCategoryHeaderTypeArticles = 1,
        SCSCategoryHeaderTypeChildCategories,
    }

    Swift

    enum SCSCategoryHeaderType : Int
  • A SCSCategoryGroup represents a data category group. A category group contains a hierarchical tree of data categories.

    Refer to SCSCategory for a representation of data categories.

    See more

    Declaration

    Objective-C

    
    @interface SCSCategoryGroup : NSObject

    Swift

    class CategoryGroup : NSObject
  • View controller capable of showing the contents of a category, whether it be child categories, articles, or both. It can be controlled through assigning a containing category to the category property, and implementing the SCSCategoryViewControllerDelegate methods.

    See more

    Declaration

    Objective-C

    @interface SCSCategoryViewController : UIViewController

    Swift

    class SCSCategoryViewController : UIViewController
  • Delegate protocol to allow the receiver to interact with, and control the experience of, a category view controller.

    See more

    Declaration

    Objective-C

    @protocol SCSCategoryViewControllerDelegate <NSObject>

    Swift

    protocol SCSCategoryViewControllerDelegate : NSObjectProtocol
  • Possible Knowledge error response codes.

    See more

    Declaration

    Objective-C

    enum SCSKnowledgeErrorCode : NSInteger {}

    Swift

    enum SCSKnowledgeErrorCode : Int
  • View controller that implements the built-in “Support Home” experience. This class is not meant to be used when using SCServiceInterface.

    See more

    Declaration

    Objective-C

    @interface SCSKnowledgeHomeViewController : UIViewController

    Swift

    class SCSKnowledgeHomeViewController : UIViewController
  • Delegate protocol for events related to the SCSKnowledgeHomeViewController.

    See more

    Declaration

    Objective-C

    @protocol SCSKnowledgeHomeViewControllerDelegate <NSObject>

    Swift

    protocol SCSKnowledgeHomeViewControllerDelegate : NSObjectProtocol
  • An SCSMutableArticleQuery object is the mutable version of SCSArticleQuery. It manages the criteria to apply when fetching and searching knowledge articles. This query object stores the type of search, the search parameters, and any filters or constraints to apply when searching.

    Use this object with -[SCSKnowledgeManager fetchArticlesWithQuery:completion:] to download articles that match your query. To access already downloaded articles matching your query, call -[SCSKnowledgeManager articlesMatchingQuery:completion:].

    See more

    Declaration

    Objective-C

    
    @interface SCSMutableArticleQuery : SCSArticleQuery

    Swift

    class MutableArticleQuery : ArticleQuery