Communities
Here's an overview of how you can get started integrating comments into your applications
Create Repository
Create Community
When creating a new community, first instantiates the EkoCommunityRepository
, a class that contain all community related methods. Then call createCommunity()
to obtain the RxJava and observe it in order to obtain the final community model.
With Avatar
If you prefer create community with an avatar you can first upload image with EkoFileRepository
then pass the obtained EkoImage
to createCommunity
API.
Step 1.
Step 2.
Join Community
The joinCommunity()
method will add the active user as a member of the channel.
This API can be called as many time as needed. If the community has already been joined, a "success" result will be returned, ie., going into doOnComplete{}
block.
Leave Community
Get Community
In the case where you only want to fetch a community data without joining, you can use the getCommunity(:id)
method:
Community Query
There are methods to obtain communities that only match specific criteria:
the
withKeyword
parameter let you filter communities based on the communitydisplayName
the
sortBy
parameters let you filter communities based on the order that the communities were created or based on alphabetical orderthe
filter
parameter let you filter communities based on the logged in user membership statusthe
categoryId
parameters let you filter communities based on community categories
Enum Types
EkoCommunitySortOption
EkoCommunityFilter
Update Community
If you want to update a community, you can call the following:
Note. By default, only the community's original creator or administrators can update the community.
Community Membership
You can get a list of community members by calling the following method:
Enum Types
EkoCommunityMembershipFilter
EkoCommunityMembershipSortOption
Note. By default of sortBy is LAST_CREATED so you can skip .sortBy in builder
also you can query community membership with userId by use getCommunityMembership(:userId)
via EkoCommunityParticipation
.
Role and Permission
Creator of community can add and remove role of user via EkoCommunityModeration
.
Role
Query memberships by role
The EkoCommunityParticipation
provides a list of members by role in the given community.
Permission
You can check your permission in community by sending EkoPermission
enums to EkoClient.hasPermission(:ekoPermission)
method.
Community Categories
The EkoCommunityRepository
will also be able to manage community categories. When communities are put into a category, you will be able to sort and filter each of the communities in that category.
Note. Right now categories will only be creatable and updatable from the Amity Social Cloud Console.
Category Query
This method provides the ability to obtain all the categories.
Enum Types
EkoCommunityCategorySortOption
Note. By default of sortBy is NAME so you can skip .sortBy in builder
Last updated