# Session destroyed when first joined HOST kills the app

**URL:** <https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240>\
**Category:** iOS\
**Created:** [September 1, 2022, 9:06am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240 "2022-09-01T09:06:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rokgregoric](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rokgregoric/32/40678_2.png) [@rokgregoric](https://devforum.zoom.us/u/rokgregoric)\
**Post date:** [September 1, 2022, 9:06am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/1 "2022-09-01T09:06:02Z")

</div>

**Description**  
Session is destroyed when first joined HOST kills the app.

**Which iOS Video SDK version?**

- 1.3.0 - 1.4.0

**To Reproduce**  
Steps to reproduce the behavior:

1. join session with multiple hosts (all users need to be hosts so they can unmute themselves)
2. kill the app of one of the users
3. all users are disconnected - the session was destroyed. The SDK reports the following error:

```auto
{
  "code" : 2008,
  "description" : "Disconnecting to the session due to failover.",
  "name" : "Session_Disconncting",
  "suggestion" : "Please clean up your UI components and try to reconnect to the session."
}

```

---

<div class="post-metadata">

**Author:** ![parker](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/parker/32/40768_2.png) [@parker](https://devforum.zoom.us/u/parker)\
**Post date:** [September 2, 2022, 2:11am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/2 "2022-09-02T02:11:21Z")

</div>

@rokgregoric are you calling `zoom.leave(true) `? We had to write some logic to evaluate if it wasn’t the host (or not person the we wanted to kill the session), then we called `zoom.leave()` and passed that empty (without true). Then the session properly stayed active.

As described briefly here: [Reference](https://marketplace.zoom.us/docs/sdk/video/web/reference/)

Under `videoClient > leave `

---

<div class="post-metadata">

**Author:** ![rokgregoric](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rokgregoric/32/40678_2.png) [@rokgregoric](https://devforum.zoom.us/u/rokgregoric)\
**Post date:** [September 2, 2022, 2:40am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/3 "2022-09-02T02:40:21Z")

</div>

@parker no … I am not calling `zoom.leave(true)` … in fact I don’t call it at all … since the app crashes / is killed.

As workaround I’ve added a `zoom.disconnect()` call in the `appWillTerminate` callback … just before calling `zoom.appWillTerminate()` and this seems to prevent the problem from happening.

But if the app crashes for any reason (for the first HOST) I don’t have a way to call that.

---

<div class="post-metadata">

**Author:** ![jackie.chen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackie.chen/32/19282_2.png) [@jackie.chen](https://devforum.zoom.us/u/jackie.chen)\
**Post date:** [September 8, 2022, 9:26am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/4 "2022-09-08T09:26:20Z")

</div>

@rokgregoric  
Thank you for reporting this issue.  
It seems your app crashed when you receive the error of Errors\_Session\_Disconncting(2008), right?  
Would you mind to give us a call stack of this crash issue?  
Thanks

---

<div class="post-metadata">

**Author:** ![rokgregoric](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rokgregoric/32/40678_2.png) [@rokgregoric](https://devforum.zoom.us/u/rokgregoric)\
**Post date:** [September 8, 2022, 10:04am UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/5 "2022-09-08T10:04:06Z")

</div>

@jackie.chen no … our users are killing the app from the app switcher and when I tried to replicate that I noticed that the session was destroyed if the first joined HOST did that.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 8, 2022, 8:04pm UTC](https://devforum.zoom.us/t/session-destroyed-when-first-joined-host-kills-the-app/75240/6 "2022-10-08T20:04:08Z")

</div>

Closed on October 8, 2022, 8:04pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
