communityId
String
channelId
String
userId
String
displayName
String
avatarFileId
String
description
String
isOfficial
Boolean
isPublic
Boolean
onlyAdminCanPost
Boolean
tags
Array.<String>
metadata
Object
postsCount
Integer
membersCount
Integer
isJoined
Boolean
categoryIds
Array.<String>
isDeleted
Boolean
false
createdAt
String($date-time)
updatedAt
String($date-time)
hasFlaggedComment
Boolean
false
CommunityRepository
, a class that contains all community-related methods. Then, call createCommunity()
to obtain the LiveObject and observe it in order to obtain the final community model.avatarFileId
is the fileId
from the model you will receive from the live object used to upload file via FileRepository
. To upload files and images, refer to File Handling.once()
. Unlike on()
, once()
will automatically unregister the event listener once the first event is emitted. This is useful if you just need to use the model once but do not need to listen to further events.communityForId()
method:closeCommunity
method. It accepts the community ID as the parameter.search
parameter let you filter communities based on the community displayName
isJoined
parameter let you filter communities based on the logged-in user membership statustags
parameters let you filter communities based on the tags set (or not set) in each communitycategories
parameters let you filter communities based on community categoriessortBy
parameters let you filter communities based on the order that the communities were created or based on alphabetical ordergetCommunityMembers
method. It accepts the following parameters:communityId
- the ID of the community to querymemberships
- filter for membership type. The possible values are: (see CommunityUserMembership
)'none'
- not a member of the community'member'
- member of the community'banned'
- member banned from the community 'muted'
- member muted from the communityroles
- filter members by specific rolesortBy
- sorting method to arrange the returned collection. The possible values are: (see CommunitySortingMethod
)'firstCreated'
'lastCreated'
'displayName'
search
- query stringLiveCollection
instance.CommunityRepository
class provides a way to moderate the community by banning or unbanning users. banUsers
and unbanUsers
methods accept an array of user ids to ban and unban respectively. addRoles
or removeRoles
functions respectively. These functions accept an array of strings as an argument that contains the roles that you want to add or remove from a specific user.CommunityRepository
will also be able to manage community categories. When communities are put into categories, you will be able to sort and filter each of the community by categories.Currently, categories can only be created and updated from the admin panel.
categoryForId()
method:needApprovalOnPostCreation
to true
:Feed.Reviewing
. Once approved, it will be moved to FeedType.Published
. If it is declined, it will be moved toFeedType.Declined
. If the post review is turned off, the new post will be added immediately in FeedType.Published
.The post review is skipped for posts which are created by community owners or moderators. They will be added inFeedType.Published
, bypassingFeedType.Reviewing
.
postCount
: