social.plus SDK enables retrieval of detailed community information without requiring membership, perfect for building community previews, exploration interfaces, and membership decision flows. Access comprehensive community data including metadata, member counts, and settings with real-time updates.

Community Details

Access name, description, avatar, and basic community information

Membership Data

View member counts, join status, and community accessibility

Live Updates

Real-time synchronization of community changes and member activity

Preview Mode

Explore communities without joining for informed membership decisions
Community data is returned as Live Objects that automatically update when changes occur, ensuring your UI stays synchronized with the latest community information, member counts, and settings.

Get Community by ID

The getCommunity() method retrieves detailed community information using the community ID, returning a Live Object that observes real-time updates including member counts, community settings, and metadata changes.

Parameters

ParameterTypeRequiredDescription
communityIdStringYesUnique identifier of the community to retrieve
var token: AmityNotificationToken?

func getCommunity(communityId: String) {
    token = communityRepository.getCommunity(withId: communityId).observe { liveObject, error in
        if let error = error {
            print("Error retrieving community: \(error)")
            return
        }
        
        guard let community = liveObject.snapshot else {
            print("Community not found")
            return
        }
        
        // Access community information
        print("Community ID: \(community.communityId)")
        print("Name: \(community.displayName)")
        
        // Handle the community data in your UI
        updateCommunityUI(with: community)
    }
}