2022-04-12 00:31:36 +08:00
|
|
|
//
|
|
|
|
// AppDelegate.swift
|
|
|
|
//
|
|
|
|
// Created by Tiago Daniel Jacobs on 11/03/22.
|
|
|
|
//
|
2022-03-04 09:14:05 +08:00
|
|
|
import UIKit
|
2022-08-23 02:57:25 +08:00
|
|
|
import bigbluebutton_tablet_sdk
|
2022-03-04 09:14:05 +08:00
|
|
|
|
|
|
|
@UIApplicationMain
|
|
|
|
class AppDelegate: UIResponder, UIApplicationDelegate, RCTBridgeDelegate {
|
|
|
|
|
|
|
|
var window: UIWindow?
|
|
|
|
var bridge: RCTBridge!
|
|
|
|
|
|
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
|
|
|
|
|
|
bridge = RCTBridge(delegate: self, launchOptions: launchOptions)
|
|
|
|
let rootView = RCTRootView(bridge: bridge!, moduleName: Bundle.main.infoDictionary![kCFBundleNameKey as String] as! String, initialProperties: nil)
|
|
|
|
|
|
|
|
if #available(iOS 13.0, *) {
|
|
|
|
rootView.backgroundColor = .systemBackground
|
|
|
|
} else {
|
|
|
|
rootView.backgroundColor = .white
|
|
|
|
}
|
|
|
|
|
|
|
|
let rootViewController = UIViewController()
|
|
|
|
rootViewController.view = rootView
|
|
|
|
|
|
|
|
self.window = UIWindow(frame: UIScreen.main.bounds)
|
|
|
|
self.window?.rootViewController = rootViewController
|
|
|
|
self.window?.makeKeyAndVisible()
|
|
|
|
|
2022-03-04 11:07:36 +08:00
|
|
|
BigBlueButtonSDK.initialize(broadcastExtensionBundleId: Constants.broadcastExtensionBundleId, appGroupName: Constants.appGroupName)
|
2022-03-04 09:14:05 +08:00
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
2022-06-16 03:14:57 +08:00
|
|
|
|
|
|
|
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
|
|
|
|
BigBlueButtonSDK.handleDeepLink(app, open: url, options: options)
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2022-06-17 04:11:03 +08:00
|
|
|
func applicationWillTerminate(_ application: UIApplication) {
|
|
|
|
BigBlueButtonSDK.onAppTerminated()
|
|
|
|
}
|
2022-03-04 09:14:05 +08:00
|
|
|
|
|
|
|
func sourceURL(for bridge: RCTBridge!) -> URL! {
|
|
|
|
//#if DEBUG
|
2022-05-03 04:59:24 +08:00
|
|
|
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
|
2022-03-04 09:14:05 +08:00
|
|
|
//#else
|
|
|
|
// let mainBundle = Bundle.main
|
|
|
|
// return mainBundle.url(forResource: "main", withExtension: "jsbundle")!
|
|
|
|
//#endif
|
|
|
|
}
|
|
|
|
}
|