我从他们的 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 或执行任何其他操作。