# SyncManager NOT working in iOS Web Safari. But works if Dev Tools is opened

**URL:** <https://community.sendbird.com/t/syncmanager-not-working-in-ios-web-safari-but-works-if-dev-tools-is-opened/1481>\
**Category:** JavaScript\
**Tags:** syncmanager, chatsdk\
**Created:** [December 19, 2020, 2:09pm UTC](https://community.sendbird.com/t/syncmanager-not-working-in-ios-web-safari-but-works-if-dev-tools-is-opened/1481 "2020-12-19T14:09:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vipin/32/726_2.png) [@vipin](https://community.sendbird.com/u/vipin)\
**Post date:** [December 19, 2020, 2:09pm UTC](https://community.sendbird.com/t/syncmanager-not-working-in-ios-web-safari-but-works-if-dev-tools-is-opened/1481/1 "2020-12-19T14:09:12Z")

</div>

I am following the documentation given here:

> **[About SyncManager | SyncManager JavaScript SDK | Sendbird Docs](https://sendbird.com/docs/syncmanager/v1/javascript/getting-started/about-syncmanager)**
>
> Learn about Sendbird Chat SyncManager and try our sample app for JavaScript.

to set up Sendbird Syncmanager in a Javascript Application

**"sendbird": “^3.0.140”,**  
**"sendbird-syncmanager": "^1.1.21"**

I am able to retrieve the channel list, but it is not working in iOS Safari. When checked with `window.onerror` I am getting the error message as shown in the image attached.

Also see the image of the source code where the error is coming.  
My code is given below:

```
    const sb = new SendBird({
      appId: <app id here> });

SendBirdSyncManager.sendBird = sb;
const options = new SendBirdSyncManager.Options();
options.messageCollectionCapacity = 2000;
options.messageResendPolicy = "automatic";
options.automaticMessageResendRetryCount = 5;
options.maxFailedMessageCountPerChannel = 50;
options.failedMessageRetentionDays = 7;

SendBirdSyncManager.setup("BHVVX71", options, () => {
  sb.connect("BHVVX71")
    .then((user) => {
      const query = sb.GroupChannel.createMyGroupChannelListQuery();
      const collection = new SendBirdSyncManager.ChannelCollection(query);
      const handler = new SendBirdSyncManager.ChannelCollection.CollectionHandler();

      handler.onChannelEvent = (action, channels = []) => {
        switch (action) {
          case "insert":
            channels.map((item) => {
              const app = document.querySelector("#root");
              app.innerHTML += `<div>${item.name}</div>`;
            });
            // TODO: Add channels to the view.
            break;
        }
      };
      collection.setCollectionHandler(handler);
      collection.fetch();
    })
    .catch(() => {});
});

window.onerror = function (message, source, lineno, colno, error) {
  alert(message);
}; 

```

**The same code is working in iOS Safari when developer tool is open and it lists all the channels without showing any error.** See the last image in the attachment

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/d277f2feba8804511a9e41a66abcc9b3a15adcae.jpeg)

Please let me know if this some issue in the code.

Thanks

---

<div class="post-metadata">

**Author:** ![vipin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/vipin/32/726_2.png) [@vipin](https://community.sendbird.com/u/vipin)\
**Post date:** [January 15, 2021, 12:51pm UTC](https://community.sendbird.com/t/syncmanager-not-working-in-ios-web-safari-but-works-if-dev-tools-is-opened/1481/2 "2021-01-15T12:51:52Z")

</div>

The above issue is not coming with

```
"sendbird": "^3.0.111",
"sendbird-syncmanager": "^1.1.14",
```
