# IMeetingShareController -\>SetEvent does not work as expected

**URL:** <https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471>\
**Category:** Meeting SDK\
**Created:** [December 20, 2023, 4:39am UTC](https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471 "2023-12-20T04:39:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![psculley](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/psculley/32/55038_2.png) [@psculley](https://devforum.zoom.us/u/psculley)\
**Post date:** [December 20, 2023, 4:39am UTC](https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471/1 "2023-12-20T04:39:17Z")

</div>

Meeting SDK for Linux v5.16.10.718 (latest)

I am successfully using the meetingsdk-linux-raw-recording-sample and have added a IMeetingShareCtrlEvent listener by calling meetingShareController-\>SetEvent().

The listener works correctly if sharing has not already been started; however, if a user in the meeting has already started sharing their screen when the bot has joined, then the listener does not detect any onSharingStatus events.

**My code is as follows:**

IMeetingShareController \*meetingShareController = m\_pMeetingService-\>GetMeetingShareController();  
SDKError shareEventError = meetingShareController-\>SetEvent(new MeetingShareCtrlEventListener());

The shareEventError = SDKERR\_SUCCESS but no events are received if any user in the meeting has already started sharing.

**Steps to reproduce:**

1. Start a meeting AND start sharing the screen or window
2. Start the meetingsdk-linux-raw-recording-sample and the bot joins
3. Call IMeetingShareController-\>SetEvent(myListener)

**Expected behavior:** myListener receives onSharingStatus events such as when a user starts/stops sharing.

**Actual behavior:** no onSharingStatus events are received.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [December 20, 2023, 7:32am UTC](https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471/2 "2023-12-20T07:32:54Z")

</div>

@psculley ,

Just to confirm, you are observing that

`Call IMeetingShareController->SetEvent(myListener)`

does not capture subsequent share related events which happens after, right?

---

<div class="post-metadata">

**Author:** ![psculley](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/psculley/32/55038_2.png) [@psculley](https://devforum.zoom.us/u/psculley)\
**Post date:** [December 22, 2023, 5:52am UTC](https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471/3 "2023-12-22T05:52:40Z")

</div>

Hi Chun,

You are correct but the issue occurs only **when a user in the Zoom meeting is already sharing at the time when the SDK joins and calls IMeetingShareController-\>SetEvent(myListener)**.

From that point on the events are never triggered even if the same or another user shares or stops sharing.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [December 22, 2023, 9:14am UTC](https://devforum.zoom.us/t/imeetingsharecontroller-setevent-does-not-work-as-expected/100471/4 "2023-12-22T09:14:45Z")

</div>

@psculley , thanks for the information. I’ve managed to replicate this issue and will be filling a ticket for this bug  
ZOOM-647946
