Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
- // Override point for customization after application launch.
- QBSettings.setApplicationID(K.quickbloxAppID)
- QBSettings.setAuthKey(K.quickbloxAuthKey)
- QBSettings.setAuthSecret(K.quickbloxAuthSecret)
- QBSettings.setAccountKey(K.quickbloxAccountKey)
- QBRTCClient.initializeRTC()
- return true
- }
- class ViewController: UIViewController, QBRTCClientDelegate {
- override func viewDidLoad() {
- super.viewDidLoad()
- QBRequest.logIn(withUserEmail: "login", password: "password", successBlock: { (res, us) in
- print((us?.login)! + " logged in")
- }, errorBlock: nil)
- QBRTCClient.instance().add(self)
- }
- @IBAction func callClicked(_ sender: Any) {
- let IDs: [NSNumber] = [NSNumber(value: 24875869)]
- let user = QBUUser()
- user.login = "login"
- user.password = "password"
- user.id = (QBSession.current().currentUser?.id)!
- QBChat.instance().connect(with: user) { (err) in
- if err != nil {
- print("ERROR")
- print(err.debugDescription)
- }
- let newSession = QBRTCClient.instance().createNewSession(withOpponents: IDs, with: QBRTCConferenceType.video)
- let userInfo :[String:String] = ["key":"value"]
- newSession.startCall(userInfo)
- }
- }
- func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
- print("Session Received")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement