Using Amity flutter SDK to fetch the Global Feed of current loggedIn user but feed is not coming in chronological order. However in documentation is mentioned that posts will be in chronological order.
Global Feed documention link
The code snippet i have used is
tawait AmitySocialClient.newFeedRepository()
.getGlobalFeed()
.getPagingData(token: token, limit: 5);
Also, i verified it through the API response of the API https://apix.us.amity.co/api/v4/me/global-feeds?limit=5
The response of post is also not in chronological order or not sorted by timestamp.
{
"posts": [
{
"_id": "6502dc54d705b03854ae8f13",
"path": "64a67c52725b00292f5f3333/social/user/64feaeca62c509fe15d7f63c/post/6502dc54d705b03854ae8f13",
"sharedCount": 0,
"targetType": "user",
"dataType": "text",
"commentsCount": 60,
"editedAt": "2023-09-14T10:11:32.896Z",
"createdAt": "2023-09-14T10:11:32.896Z",
"updatedAt": "2023-09-14T10:14:16.808Z",
"isDeleted": false,
"hasFlaggedComment": false,
"hasFlaggedChildren": false,
"data": {
"text": "comments test"
},
"postId": "6502dc54d705b03854ae8f13",
"postedUserId": "6363629dd33cc0ac8b500d1d",
"targetId": "6363629dd33cc0ac8b500d1d",
"flagCount": 0,
"hashFlag": null,
"reactions": {
"like": 1
},
},
{
"_id": "6502d518d705b0626bad8fd3",
"path": "64a67c52725b00292f5f3333/social/user/64feaeca62c509fe15d7f63c/post/6502d518d705b0626bad8fd3",
"sharedCount": 0,
"targetType": "user",
"dataType": "text",
"commentsCount": 5,
"editedAt": "2023-09-14T09:40:40.317Z",
"createdAt": "2023-09-14T09:40:40.317Z",
"updatedAt": "2023-09-14T09:41:46.389Z",
"isDeleted": false,
"hasFlaggedComment": false,
"hasFlaggedChildren": false,
"data": {
"text": "General post to all the members "
},
"postId": "6502d518d705b0626bad8fd3",
"postedUserId": "6363629dd33cc0ac8b500d1d",
"targetId": "6363629dd33cc0ac8b500d1d",
"flagCount": 0,
"hashFlag": null,
"reactions": {
"like": 1,
"angry": 1,
"wow": 1,
"sad": 1
},
},
{
"_id": "65040cff33717b31164b81da",
"path": "64a67c52725b00292f5f3333/social/user/650304ddfbb62668614bd5b4/post/65040cff33717b31164b81da",
"sharedCount": 0,
"targetType": "user",
"dataType": "text",
"metadata": {
"mentioned": []
},
"commentsCount": 0,
"editedAt": "2023-09-15T07:51:27.908Z",
"createdAt": "2023-09-15T07:51:27.908Z",
"updatedAt": "2023-09-15T07:51:27.909Z",
"isDeleted": false,
"hasFlaggedComment": false,
"hasFlaggedChildren": false,
"data": {
"text": "Test GlobalFeedPost order"
},
"postId": "65040cff33717b31164b81da",
"postedUserId": "62e8d8209217132fe277a52d",
"targetId": "62e8d8209217132fe277a52d",
},
{
"_id": "6503243bd705b0b801bc8e82",
"path": "64a67c52725b00292f5f3333/social/user/64feaeca62c509fe15d7f63c/post/6503243bd705b0b801bc8e82",
"sharedCount": 0,
"targetType": "user",
"dataType": "text",
"metadata": {
"fileUrl": "https://api.us.amity.co/api/v3/files/6503242a55756434504439e1/download",
"type": "6503242a55756434504439e1"
},
"commentsCount": 0,
"editedAt": "2023-09-14T15:18:19.355Z",
"createdAt": "2023-09-14T15:18:19.355Z",
"updatedAt": "2023-09-14T15:18:19.361Z",
"isDeleted": false,
"hasFlaggedComment": false,
"hasFlaggedChildren": false,
"data": {
"text": "Newsfeed for post"
},
"postId": "6503243bd705b0b801bc8e82",
"postedUserId": "6363629dd33cc0ac8b500d1d",
"targetId": "6363629dd33cc0ac8b500d1d",
},
{
"_id": "65031f5f287db2ceae8127c0",
"path": "64a67c52725b00292f5f3333/social/user/64feaeca62c509fe15d7f63c/post/65031f5f287db2ceae8127c0",
"sharedCount": 0,
"targetType": "user",
"dataType": "text",
"metadata": {
"fileUrl": "https://api.us.amity.co/api/v3/files/65031f4d3f3187907c0e26a4/download",
"type": "65031f4d3f3187907c0e26a4"
},
"commentsCount": 0,
"editedAt": "2023-09-14T14:57:35.324Z",
"createdAt": "2023-09-14T14:57:35.324Z",
"updatedAt": "2023-09-14T14:57:35.328Z",
"isDeleted": false,
"hasFlaggedComment": false,
"hasFlaggedChildren": false,
"data": {
"text": "Posting video feed"
},
"postId": "65031f5f287db2ceae8127c0",
"postedUserId": "6363629dd33cc0ac8b500d1d",
"targetId": "6363629dd33cc0ac8b500d1d",
}
],
}
FYI: Response is trimmed for sharing purpose.