Pinned posts provide maximum visibility for important content in your community. The SDK offers comprehensive functionality to query and display pinned posts across different placement types.

Default Pins

Featured posts at the top of community feeds

Announcements

Important updates in dedicated announcement sections

Global Featured

Platform-wide featured content for maximum visibility

Pin Placement Types

Different placement types determine where pinned posts appear in your app’s interface.
PlacementDescriptionUse CaseVisibility
defaultStandard community pinsImportant community postsCommunity members
announcementAnnouncement section pinsCritical updates, rulesCommunity members
globalPlatform-wide featuredMajor announcements, eventsAll users
Post pinning is managed through the Moderation Console. The SDK provides read-only access to display pinned content effectively.

Query Pinned Posts

Retrieve pinned posts to display at the top of community feeds, ensuring maximum visibility for important content.
let postRepository = AmityPostRepository(client: client)

// SDK provide enum type of placment for convinence use
// You can use just string if there's customization on placement
let placement = AmityPinPlacement.default.rawValue

token = postRepository.getPinnedPosts(communityId: "community-id", placement: placement, sortBy: .lastPinned).observe({ collection, change, error in
    // handle pinned post here
})
To maintain a balanced feed with fresh content, limit the number of globally featured posts to ensure optimal user experience.

Query Announcement Posts

These posts are tracked separately, similar to default pinned posts but with different behavior. Announcements are typically housed at the top of the community in a separate section, making them easily accessible without forcing users to go through every announcement. This type of pinned post is suitable for multiple important posts that need to be highlighted simultaneously, such as reminders, updates, or informational content.
let postRepository = AmityPostRepository(client: client)

// SDK provide enum type of placment for convinence use
// You can use just string if there's customization on placement
let placement = AmityPinPlacement.announcement.rawValue

token =  postRepository.getPinnedPosts(communityId: "community-id", placement: placement, sortBy: .lastPinned).observe({ collection, changes, error in
    // handle announcement post here
})
Global featured posts keep your key content prominently displayed at the top of the main feed, the typical landing page on both web and app platforms. This ensures your announcements reach the entire in-app community, maximizing visibility. The getGlobalPinnedPost() function in the social.plus SDK provides a dedicated collection of featured posts that are intended to appear at the top of the global feed, ensuring users see these posts first, regardless of community affiliation.
token = postRepository.getGlobalPinnedPosts().observe { liveCollection, _, error in
    
    let pinnedPosts: [AmityPinnedPost] = liveCollection.snapshots
    for pinnedPost in pinnedPosts {
        // access post here
        let postItem: AmityPost? = pinnedPost.post
    }
}

Use Cases

Community Announcements

Pin important community rules, events, or policy updates

Featured Content

Highlight exceptional user-generated content or discussions

Event Promotion

Feature upcoming events or time-sensitive information

Welcome Messages

Pin welcome posts for new community members

Best Practices

Troubleshooting