# Unable to fetch messages with new SBDMessageListParams & SBDThreadedMessageListParams

**URL:** https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594
**Category:** iOS
**Tags:** chatsdk
**Created:** [July 7, 2020, 8:15pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594 "2020-07-07T20:15:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Rachel\_Pekarek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/rachel_pekarek/32/340_2.png) [@Rachel\_Pekarek](https://community.sendbird.com/u/Rachel_Pekarek)
#### Post date: [July 7, 2020, 8:15pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/1 "2020-07-07T20:15:16Z")

</div>

I’m using version 3.0.187 of the SendBirdSDK pod and have been unable to retrieve any messages from a given channel after I post them when I use the new `SBDMessageListParams`

```
let listParams = SBDMessageListParams()
listParams.reverse = false
listParams.messageType = .all
listParams.includeThreadInfo = true
    
channel.getMessagesByTimestamp(timestamp, params: listParams) { (messages, error) in
    if (error == nil) {
        //Messages always empty array
    }
}

```

Everything appears okay when I send the messages initially (both with and without a parentMessageId), they just aren’t returned when I go to fetch them again:

```
let params = SBDUserMessageParams(message: message)
if let parentId = parentMessageId {
    params?.parentMessageId = parentId
}

var preSendMessage: GMKUserMessage?
preSendMessage = channel.sendUserMessage(with: params) { [weak self] (userMessage, error) in
    self?.endTyping()
    if error != nil {
        self?.markSendFailed(preSendMessage)
    } else if let message = userMessage {
        //Making it here
        self?.markSendSuccessful(preSendMessage, newMessage: message)
    }
}

```

When a parent message Id is present, and I try to fetch the associated threaded messages from the parent using `SBDThreadedMessageListParams`, I get the same result. No error and an empty array of messages, even after I have successfully sent child messages:

```
let listParams = SBDThreadedMessageListParams()
listParams.reverse = false
listParams.messageType = .all

parentMessage.getThreadedMessages(byTimestamp: timestamp, params: listParams) { (parentMessage, messages, error) in

    if let messages = messages {
        //Messages array always empty, parentMessage returns successfully
    }
}
```

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [July 7, 2020, 8:37pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/2 "2020-07-07T20:37:28Z")

</div>

@Rachel_Pekarek Hi Rachel, I believe you cannot use thread feature yet (its still EAP phase)

---

<div class="post-metadata">

### Author: ![Rachel\_Pekarek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/rachel_pekarek/32/340_2.png) [@Rachel\_Pekarek](https://community.sendbird.com/u/Rachel_Pekarek)
#### Post date: [July 7, 2020, 8:49pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/3 "2020-07-07T20:49:34Z")

</div>

We are a part of the EAP and have been told this feature should be turned on for us

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [July 7, 2020, 9:23pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/4 "2020-07-07T21:23:36Z")

</div>

Can you tell me your app id?

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [July 7, 2020, 9:53pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/6 "2020-07-07T21:53:28Z")

</div>

Can you set `previousResultSize` in `SBDThreadedMessageListParams` to some numbers and see if it retrieves messages?

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [July 7, 2020, 9:56pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/7 "2020-07-07T21:56:31Z")

</div>

`previousResultSize` is like limit for # of message to be fetched. This property is initially 0 (which I think it should be some # instead 0), so I believe you have to set some number for it

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [July 7, 2020, 10:00pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/8 "2020-07-07T22:00:52Z")

</div>

`previousResultSize` and `nextResultSize` is 0 and you have to set some number to fetch messages. These values are used to fetch messages based on token or timestamp.

---

<div class="post-metadata">

### Author: ![Rachel\_Pekarek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/rachel_pekarek/32/340_2.png) [@Rachel\_Pekarek](https://community.sendbird.com/u/Rachel_Pekarek)
#### Post date: [July 7, 2020, 10:01pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/9 "2020-07-07T22:01:47Z")

</div>

> [@Woo](#):
>
> previousResultSize

That worked for both cases! Thank you!

---

<div class="post-metadata">

### Author: ![GoGo7](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/gogo7/32/777_2.png) [@GoGo7](https://community.sendbird.com/u/GoGo7)
#### Post date: [October 22, 2021, 1:20pm UTC](https://community.sendbird.com/t/unable-to-fetch-messages-with-new-sbdmessagelistparams-sbdthreadedmessagelistparams/594/10 "2021-10-22T13:20:13Z")

</div>

Banged my head against the wall for an hour before I found out about this.  
The REST API has a sensible default value of 15.  
I think the iOS library should follow suit.
