2

我从他们的 GitHub 获得了最新的 ZoomSDK,但它仍然非常过时,他们的文档甚至与他们的 SDK 不匹配。这个例子也有问题,并且有一大堆额外的代码几乎不能正常工作。

有没有人成功使用 ZoomSDK加入会议而无需登录

这是我到目前为止所拥有的:

let zoom: MobileRTC = MobileRTC.shared()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    let context = MobileRTCSDKInitContext.init()
    context.appGroupId = AppConfig.Constants.AppTitle
    context.domain = AppConfig.Constants.WebDomain
    context.enableLog = true

    zoom.initialize(context)

    let auth: MobileRTCAuthService = zoom.getAuthService()!
    auth.clientKey = AppConfig.Constants.AppKey
    auth.clientSecret = AppConfig.Constants.AppSecret
    auth.delegate = self
    auth.sdkAuth()

    return true
}

public func startMeeting(meetingId: String) {

    let user: MobileRTCMeetingStartParam4WithoutLoginUser = MobileRTCMeetingStartParam4WithoutLoginUser.init()
    user.userType = MobileRTCUserType_APIUser
    user.meetingNumber = meetingId
    user.userID = AppConfig.UserHash.UID
    user.isAppShare = false

    guard let meetingService = zoom.getMeetingService() else { return }
    meetingService.customizeMeetingTitle(AppConfig.Constants.AppTitle)
    meetingService.delegate = self

    window = UIApplication.shared.windows.count != 0 ? UIApplication.shared.windows[0] : nil

    // THIS ACTUALLY CRASHES
    meetingService.joinMeeting(with: [
        kMeetingParam_Username: user.userID,
        kMeetingParam_MeetingNumber: user.meetingNumber! as String,
        kMeetingParam_MeetingPassword: ""
    ])

    // Have also tried, does not crash though:
    //let options = MobileRTCMeetingStartParam.init()
    //options.meetingNumber = meetingId
    //options.participantID = AppConfig.UserHash.UID
    //meetingService.startMeeting(with: param)
}

所有值都可以,我什至得到了成功的 Auth 响应。它只是在尝试开始会议时不会打开任何 Zoom UI 或执行任何其他操作。

4

1 回答 1

0

SDK再次更新,这里是加入会议的更新版本。

    let service = MobileRTC.shared().getMeetingService()
    if service != nil {
        service?.delegate = self
        
        let user = MobileRTCMeetingJoinParam()
        user.meetingNumber = meetingID
        user.userName = userName
        user.zak = "---Your Access Token---"
                    
        let response = service?.joinMeeting(with: user)
        if let response = response {
            print("onJoinMeeting, response: \(response)")
        }
    }
于 2020-11-03T11:57:37.813 回答