# Cannot connect to the sendbird server using Sendbird React Native UIKIT useConnection hook

**URL:** <https://community.sendbird.com/t/cannot-connect-to-the-sendbird-server-using-sendbird-react-native-uikit-useconnection-hook/6949>\
**Category:** Miscellaneous\
**Created:** [April 3, 2023, 2:34pm UTC](https://community.sendbird.com/t/cannot-connect-to-the-sendbird-server-using-sendbird-react-native-uikit-useconnection-hook/6949 "2023-04-03T14:34:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namrata\_Jain](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/namrata_jain/32/3826_2.png) [@Namrata\_Jain](https://community.sendbird.com/u/Namrata_Jain)\
**Post date:** [April 3, 2023, 2:34pm UTC](https://community.sendbird.com/t/cannot-connect-to-the-sendbird-server-using-sendbird-react-native-uikit-useconnection-hook/6949/1 "2023-04-03T14:34:15Z")

</div>

We are facing difficulty while working with Sendbird React Native UIKIT. So, we are trying to connect to the Sendbird server using the `useConnection` hook provided by Sendbird react native uikit. It gives us an error with a status code of 800120.

The steps that we have followed are:

1. Wrapping of our app in the `SendbirdUiKitContainer`

```auto
<SendbirdUIKitContainer
              appId="F53DF97C-E104-4603-A396-8FC7DB7BB37A"
              chatOptions={{ localCacheStorage: AsyncStorage }}
              platformServices={{
                file: FileService,
                notification: NotificationService,
                clipboard: ClipboardService,
                media: MediaService,
              }}
            >
              // our app
            </SendbirdUIKitContainer>

```

1. and then connecting to the Sendbird server.

```auto
  const onPressChatWithUs = async () => {
    console.log("before connection");
    try {
      const response = await connect("097094", {
        nickname: "Yuvraj",
        accessToken: "24ef5e8e34e1da4bab36ff8605bdc3cbf02b45a6",
      });
      console.log("after successful connection", response);
      navigation.navigate("GroupChannelList");
    } catch (error) {
      console.log(error);
    }
  };

```

When `onPressChatWithUs` is triggered, then it first consoles “before connection” as expected, and after a pause of 9-10 seconds throws an error with a status code of `800120`. The snapshot depicting the same is attached below.

 ![Screenshot 2023-04-03 at 11.05.43 AM](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/1/1dfe33650704c7d4e4f398c95894bc126649e851.png)

SDK versions that we have used are:

```auto
    "@sendbird/chat": "^4.6.0",
    "@sendbird/uikit-react-native": "^2.4.1",

```

When searching for the error code, it shows:

```auto
The connection failed due to the unstable network or an unexpected error in the Chat SDK network library.

```

We have followed each step mentioned on [https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#1-send-your-first-message](https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#1-send-your-first-message) precisely

Can someone please assist us to resolve this issue?

---

<div class="post-metadata">

**Author:** ![Namrata\_Jain](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/namrata_jain/32/3826_2.png) [@Namrata\_Jain](https://community.sendbird.com/u/Namrata_Jain)\
**Post date:** [April 6, 2023, 4:41am UTC](https://community.sendbird.com/t/cannot-connect-to-the-sendbird-server-using-sendbird-react-native-uikit-useconnection-hook/6949/2 "2023-04-06T04:41:36Z")

</div>

Update:

It works fine on real device, however on emulator it throws the same error that too with a delay of atleast 9-10 seconds.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [April 10, 2023, 5:45am UTC](https://community.sendbird.com/t/cannot-connect-to-the-sendbird-server-using-sendbird-react-native-uikit-useconnection-hook/6949/3 "2023-04-10T05:45:33Z")

</div>

Hello @Namrata_Jain,

Welcome to the Sendbird Community.

If it works fine on a real device, it seems to be that there may be an issue with the emulator and it’s connection out to Sendbird causing it to take too long. Are you able to capture any network traffic to see when the request is made and when it gets a response (if at all)?
