How to customize the Community module for the ASAP React Native SDK?
To override the default functionalities of the Community, we can use the following code snippet.
- import {ZohoDeskPortalCommunity} from '@zohocorp/zohodesk-portal-community';
//The default value for the configuration is true
ZohoDeskPortalCommunity.setConfiguration(
{
isTopicEditAllowed: true,
isTopicDeleteAllowed: true,
isReplyAllowed: true,
isReplyEditAllowed: true,
isReplyDeleteAllowed: true,
isTopicDetailSearchAllowed: true,
});
By default, all the configurations will work based on the user's authentication state and the relevant Help Center configuration.
Method name | Functions | Default enabled/disabled status |
isTopicEditAllowed
| To allow topic edit
| Enabled
|
isTopicDeleteAllowed
| To allow topic delete
| Enabled |
isReplyAllowed
| To allow reply
| Enabled |
isReplyEditAllowed
| To allow reply edit
| Enabled |
isReplyDeleteAllowed
| To allow reply delete
| Enabled |
isTopicDetailSearchAllowed
| To allow topic detail search
| Enabled |
Get Most Popular Topics
We have the API provision to fetch the most popular topics. The code snippet:
- import {ZohoDeskPortalSDK} from '@zohocorp/zohodesk-portal-apikit'
var queryParams = {
'categoryId': 'your_CategoryID'
}
ZohoDeskPortalSDK.getMostPopularTopics(queryParams
,(success) => {
console.log(success);
},(error) => {
console.log("Error:", error);
})
Query Params
- CategoryId - ID of the category from which topics are to be retrieved.
- from - index from which the list is retrieved, and it starts from 1.
- limit - Number of topics to list.
- type - Topic Type - value can be QUESTION, IDEA, ANNOUNCEMENT, PROBLEM or DISCUSSION.
Get Most Discussed Topics
We have the API provision to fetch the most discussed topics. The code snippet:
- import {ZohoDeskPortalSDK} from '@zohocorp/zohodesk-portal-apikit'
var queryParams = {
'categoryId': "your_categoryId"
}
ZohoDeskPortalSDK.getMostDiscussedTopics(queryParams,
(message) => {
console.log("Success:", message);
},(error) => {
console.log("Error:", error);
})
Query Params
- CategoryId - ID of the category from which topics are to be retrieved.
- from - index from which the list is retrieved, starting from 1.
- limit - Number of topics to list.
- type - Topic Type - value can be QUESTION, IDEA, ANNOUNCEMENT, PROBLEM or DISCUSSION.
Show Topic
To open the specific community topic screen:
- import {ZohoDeskPortalCommunity} from '@zohocorp/zohodesk-portal-community';
ZohoDeskPortalCommunity.showTopic("Your_community_topicID")