# Reconnect and delegate methods

**URL:** <https://community.sendbird.com/t/reconnect-and-delegate-methods/910>\
**Category:** iOS\
**Created:** [September 8, 2020, 9:20am UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910 "2020-09-08T09:20:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marko\_84](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@Marko\_84](https://community.sendbird.com/u/Marko_84)\
**Post date:** [September 8, 2020, 9:20am UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/1 "2020-09-08T09:20:46Z")

</div>

Hello , Senbird SDK v 3.0.197 (iOS Obj-C example code) , I see that method “didReconnect” from SBNetworkDelegate has never called , can you tell us more about what kind of bug it is? Would some alternative such as method “didSucceedReconnection” from SBDConnectionDelegate do the similar job?  
In short, what is the best way to refresh conversations when network is reconnected, any suggestion?

---

<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:** [September 8, 2020, 11:06pm UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/2 "2020-09-08T23:06:05Z")

</div>

> [@Marko\_84](#):
>
> didReconnect

`didReconnect` is called when you call `reconnect` method. Did you add `addLocalNetworkDelegate:` ?

---

<div class="post-metadata">

**Author:** ![Marko\_84](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@Marko\_84](https://community.sendbird.com/u/Marko_84)\
**Post date:** [September 9, 2020, 1:46pm UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/3 "2020-09-09T13:46:34Z")

</div>

sorry I dont see “addLocalNetworkDelegate:” , official example GroupChannelChatViewController class has =\>  
// **TODO: Fix bug in SDK.**  
[SBDConnectionManager addNetworkDelegate:self identifier:self.description];

can you give me more info if this fixed in some version, or simple can you give me example when you are offline and internet connection is active again which method are called from any delegates related to this point?

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jason/32/488_2.png) [@Jason](https://community.sendbird.com/u/Jason)\
**Post date:** [September 10, 2020, 12:11am UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/4 "2020-09-10T00:11:55Z")

</div>

@Marko_84

Hi. I hope you are well. Aside from the ongoing conversation with @Woo I wanted to provide you with Sendbird’s Connection Manager FAQ document. I hope it helps you understand a bit more about what is going on under the hood.

[SendBird Connection FAQ - External (4).pdf](https://community.sendbird.com/uploads/short-url/qdmXLeKa1vEgs9dVmhSeAvVenT4.pdf) (216.0 KB)

---

<div class="post-metadata">

**Author:** ![Marko\_84](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@Marko\_84](https://community.sendbird.com/u/Marko_84)\
**Post date:** [September 10, 2020, 9:35am UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/5 "2020-09-10T09:35:55Z")

</div>

@Jason Thank you Jason, the flow is clear thats ok. Please can you give me more info about comment // **TODO: Fix bug in SDK.** for connection manager in Objc-official example?

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jason/32/488_2.png) [@Jason](https://community.sendbird.com/u/Jason)\
**Post date:** [September 10, 2020, 10:34pm UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/6 "2020-09-10T22:34:58Z")

</div>

@Marko_84

I will look up the bug and ask internally. In the mean time please consider the points I make below.

- If the internet is off for less than 45 seconds Sendbird’s connection manager will handle the reconnection case.
- When the connection is returned didSucceedReconnection fires. Once didSucceedReconntection fires consider to call the [channel list](https://docs.sendbird.com/ios/group_channel#3_retrieve_a_list_of_channels) again if the user is viewing the channel list, and call to [refresh the channel](https://docs.sendbird.com/ios/group_channel#3_refresh_all_data_related_to_a_channel) if the user is viewing the message list.
- If the internet is lost for more than 45 seconds [didFailReconnection](https://docs.sendbird.com/ios/event_delegate#3_add_and_remove_a_connection_delegate) will fire.
- From this point on you will need to call [reconnect](https://docs.sendbird.com/ref/ios/Classes/SBDMain.html#//api/name/reconnect) when the internet returns. As far as I’m aware detecting internet return will come from your side. This [blog post](https://medium.com/@dkw5877/reachability-in-ios-172fc3709a37) might help with that.

---

<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:** [March 26, 2021, 10:18pm UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/7 "2021-03-26T22:18:40Z")

</div>

Current implementation on didReconnect is it will be fired only if reconnection had happened from some network error. Why don’t you just use `didSucceedReconnection` and refresh conversation when network is reconnected?

---

<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:** [March 26, 2021, 10:23pm UTC](https://community.sendbird.com/t/reconnect-and-delegate-methods/910/8 "2021-03-26T22:23:22Z")

</div>

and what do you mean by “sorry I dont see “addLocalNetworkDelegate:””? use `+ (void)addLocalNetworkDelegate:(id<SBDNetworkDelegate> _Nonnull)delegate identifier:(nonnull NSString *)identifier` to add network delegate if you needs. Both `didSucceedReconnection` and `didReconnect` will get fired when reconnection was succeeded, but `didSucceedReconnection` will get always get fired where `didReconnect` will only get fired if reconnection had happened due to some error.
