customer-android-kotlin

//core/com.kustomer.core.providers/KusKbProvider

KusKbProvider

[androidJvm]
interface KusKbProvider

This provider class is used to register/unregister device token in Core SDK.

Obtain an instance of KusPushRegistrationProvider like below:

Note: Before you begin, make sure you have initialized KustomerCore class with a valid API key

val kbProvider = KustomerCore.getInstance().kusKbProvider()

Once you have an instance of the provider, you can call methods on it and handle the KusResult object.

APIs with network or heavy data processing operations are currently marked with suspend modifier, and can be called from Kotlin Coroutines. If not using Kotlin Coroutines, then we are going to add KusCallback response support in the future

Samples

[androidJvm]
ExampleKbViewModel

Functions

Name Summary
fetchCategoryById [androidJvm]
abstract suspend fun fetchCategoryById(categoryId: String, locale: Locale): KusResult<KusKbCategory>
Fetch a category with its immediate child subcategories and articles by Id Default knowledgebase id is used if no value is overridden in the Core SDK KustomerCoreOptions.knowledgeBaseId
fetchFeaturedArticles [androidJvm]
abstract suspend fun fetchFeaturedArticles(locale: Locale): KusResult<List<KusKbArticle>>
Returns list of featured articles within a KnowledgeBase Default knowledgebase id is used if no value is overridden in the Core SDK KustomerCoreOptions.knowledgeBaseId
fetchRootCategory [androidJvm]
abstract suspend fun fetchRootCategory(locale: Locale): KusResult<KusKbCategory>
Returns root level categories and articles with in a Knowledgebase Default knowledgebase id is used if no value is overridden in the Core SDK KustomerCoreOptions.knowledgeBaseId
getArticleById [androidJvm]
abstract suspend fun getArticleById(articleId: String, locale: Locale, knowledgeBaseId: String?): KusResult<KusKbArticle>
Returns Knowledge Base Article by articleId
getKnowledgeBaseSettings [androidJvm]
abstract suspend fun getKnowledgeBaseSettings(): KusResult<KusKnowledgeBaseConfig?>?
Returns the External Domain for the current Knowledge Base
searchArticles [androidJvm]
abstract suspend fun searchArticles(term: String, page: Int, pageSize: Int, locale: Locale): KusResult<List<KusKbArticle>>
Returns list of all Knowledge Base Articles matching search term Default knowledgebase id is used if no value is overridden in the Core SDK KustomerCoreOptions.knowledgeBaseId