# onUserHostChanged is not called in iOS - Flutter

**URL:** <https://devforum.zoom.us/t/onuserhostchanged-is-not-called-in-ios-flutter/119654>\
**Category:** Video SDK\
**Tags:** video-sdk\
**Created:** [October 23, 2024, 6:02am UTC](https://devforum.zoom.us/t/onuserhostchanged-is-not-called-in-ios-flutter/119654 "2024-10-23T06:02:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathya](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sathya/32/49127_2.png) [@sathya](https://devforum.zoom.us/u/sathya)\
**Post date:** [October 23, 2024, 6:02am UTC](https://devforum.zoom.us/t/onuserhostchanged-is-not-called-in-ios-flutter/119654/1 "2024-10-23T06:02:44Z")

</div>

* * *

### Format Your New Topic as Follows:

**Video SDK Type and Version**  
flutter-zoom-video-sdk-6.1.10-1.12.10

**Description**  
I have added a waiting screen for the participants after joining the session if there is no host. And I have added a listener to get the host details. Using that I am displaying video screen. But this is not working on iOS. I have tested with 2 iOS simulator and Android Emulator. In android it is working fine as expected but in iOS, it is not working.

**Error?**  
It is still in the waiting screen only.

**How To Reproduce**  
I have added the sample code here.

```auto
 Widget fullScreenView;
    Widget smallView;
    if (isInSession.value && isHostAvailable.value
        // &&
        // fullScreenUser.value != null &&
        // users.value.isNotEmpty)
        ) {
      fullScreenView = AnimatedOpacity(
        opacity: opacityLevel,
        duration: const Duration(seconds: 3),
        child: VideoView(
          user: fullScreenUser.value,
          hasMultiCamera: false,
          isPiPView: isPiPView.value,
          sharing: sharingUser.value == null
              ? false
              : (sharingUser.value?.userId == fullScreenUser.value?.userId),
          preview: false,
          focused: false,
          multiCameraIndex: "0",
          videoAspect: VideoAspect.Original,
          fullScreen: true,
          resolution: VideoResolution.Resolution360,
        ),
      );

      smallView = Container(
        height: 110,
        margin: const EdgeInsets.only(left: 20, right: 20),
        alignment: Alignment.center,
        child: ListView.separated(
          scrollDirection: Axis.horizontal,
          itemCount: users.value.length,
          itemBuilder: (BuildContext context, int index) {
            return InkWell(
              onTap: () async {
                onSelectedUser(users.value[index]);
              },
              onDoubleTap: () async {
                onSelectedUserVolume(users.value[index]);
              },
              child: Center(
                child: VideoView(
                  user: users.value[index],
                  hasMultiCamera: false,
                  isPiPView: false,
                  sharing: false,
                  preview: false,
                  focused: false,
                  multiCameraIndex: "0",
                  videoAspect: VideoAspect.Original,
                  fullScreen: false,
                  resolution: VideoResolution.Resolution180,
                ),
              ),
            );
          },
          separatorBuilder: (BuildContext context, int index) =>
              const Divider(),
        ),
      );
    } else if (isInSession.value && !isHostAvailable.value) {
      fullScreenView = Container(
          child: const Center(
        child: Text(
          "Waiting for host...",
          style: TextStyle(
            fontSize: 20,
            color: Colors.white,
          ),
        ),
      ));
      smallView = Container(
        height: 110,
        color: Colors.transparent,
      );
    } else {
      fullScreenView = Container(
          color: Colors.black,
          child: const Center(
            child: Text(
              "Connecting...",
              style: TextStyle(
                fontSize: 20,
                color: Colors.white,
              ),
            ),
          ));
      smallView = Container(
        height: 110,
        color: Colors.transparent,
      );
    }

```

onUserHostChanged listener:-

```auto
final userHostChangedListener =
          emitter.on(EventType.onUserHostChanged, (data) async {
        if (!isMounted()) return;
        isHostAvailable.value = true;
        print('called onUserHostChanged---> ');
      });

```

Please let me know if I have missed something.

Thanks,  
Sathya.
