# Lock Meeting after 2 people Joined

**URL:** <https://devforum.zoom.us/t/lock-meeting-after-2-people-joined/29853>\
**Category:** iOS\
**Created:** [September 11, 2020, 1:04am UTC](https://devforum.zoom.us/t/lock-meeting-after-2-people-joined/29853 "2020-09-11T01:04:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aabudureheman](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aabudureheman/32/11964_2.png) [@aabudureheman](https://devforum.zoom.us/u/aabudureheman)\
**Post date:** [September 11, 2020, 1:04am UTC](https://devforum.zoom.us/t/lock-meeting-after-2-people-joined/29853/1 "2020-09-11T01:04:10Z")

</div>

**Description**  
I would like to achieve Lock Meeting after 2 people Joined, which requires constantly checking for the new join. Is there any way to get a callback for a new person joined then I can proceed to lock the meeting.

**Which version?**  
Newest

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

**Screenshots**  
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Version [e.g. 22]

**Additional context**  
Add any other context about the problem here.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [September 11, 2020, 5:54pm UTC](https://devforum.zoom.us/t/lock-meeting-after-2-people-joined/29853/2 "2020-09-11T17:54:21Z")

</div>

Hey @aabudureheman

Thanks for using the dev forum!

Good question! The `MobileRTCUserServiceDelegate` provides a callback for when a user joins:

> - ( **void** )onSinkMeetingUserJoin:(NSUInteger)userID;

Objective-C:

```
- (void)onSinkMeetingUserJoin:(NSUInteger)userID
{
    MobileRTCMeetingService *ms = [[MobileRTC sharedRTC]getMeetingService];
    if (ms) {
        NSArray *users = [ms getInMeetingUserList];

        if (users.count == 2) {
            [ms lockMeeting:YES];
        }
    }
}

```

Swift:

```
func onSinkMeetingUserJoin(_ userID: UInt) {
    if let meetingService = MobileRTC.shared().getMeetingService() {
        let users = meetingService.getInMeetingUserList()

        if users?.count == 2 {
            meetingService.lockMeeting(true)
        }
    }
}

```

Let me know if that helps!  
Michael
