The social.plus SDK provides powerful functionality to retrieve posts from your application. Whether you need a single post or multiple posts, the SDK returns results as live objects that automatically update when the underlying data changes.

Overview

Live Objects

Posts are returned as live objects that automatically update when data changes

Comprehensive Data

Retrieve complete post information including content, reactions, comments, and metadata

Single Post Retrieval

Retrieve a specific post by its unique identifier with complete post information and real-time updates.
var token: AmityNotificationToken?

func getPostByIdExample() {
    token = postRepository.getPost(withId: "<post-id>").observe { liveObject, error in
        // Observer block, Do something here
    }
}

Multiple Posts Retrieval

Retrieve multiple posts by their IDs in a single operation with live collection updates.
var token: AmityNotificationToken?

token = postRepository.getPosts(postIds: ["post-id-1", "post-id-2"]).observe { collection, changes, error in
    // Observe live collection here
}