12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- import UIKit
- import Flutter
- import NexilisLite
- @UIApplicationMain
- @objc class AppDelegate: FlutterAppDelegate, ConnectDelegate {
- func onSuccess(userId: String) {
-
- }
-
- func onFailed(error: String) {
-
- }
-
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
- APIS.connect(apiKey: "1C4FA430BC9F44484AFBE99C8974D70B68CE7891DBE83505CBF01205DE51FC18", delegate: self)
- let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
- let batteryChannel = FlutterMethodChannel(name: "nativeChannel", binaryMessenger: controller.binaryMessenger)
- batteryChannel.setMethodCallHandler({(call: FlutterMethodCall, result: FlutterResult) -> Void in
- // Note: this method is invoked on the UI thread.
- if call.method == "openContactCenter" {
- APIS.openContactCenter()
- } else if call.method == "openInstantMessaging" {
- APIS.openChat()
- } else if call.method == "openCall" {
- APIS.openCall()
- } else if call.method == "openStreaming" {
- APIS.openStreaming()
- } else if call.method == "openWhiteboard" {
- APIS.openWhiteboard()
- } else if call.method == "openSettings" {
- APIS.openSetting()
- } else if call.method == "openSetOfficer" {
- APIS.openSetAsOfficerForm()
- } else if call.method == "openContactCenterChat" {
- var category: Int?
- if let arguments = call.arguments as? [String: Any],
- let param1 = arguments["category"] as? Int {
- category = param1
- }
- APIS.openContactCenter(media: 0, category: category)
- } else if call.method == "openContactCenterAudioCall" {
- var category: Int?
- if let arguments = call.arguments as? [String: Any],
- let param1 = arguments["category"] as? Int {
- category = param1
- }
- APIS.openContactCenter(media: 1, category: category)
- } else if call.method == "openContactCenterVideoCall" {
- var category: Int?
- if let arguments = call.arguments as? [String: Any],
- let param1 = arguments["category"] as? Int {
- category = param1
- }
- APIS.openContactCenter(media: 2, category: category)
- } else if call.method == "signInAdmin" {
- var pwd: String?
- if let arguments = call.arguments as? [String: Any],
- let param1 = arguments["pwd"] as? String {
- pwd = param1
- }
- APIS.signInAdmin(password: pwd ?? "")
- } else {
- result(FlutterMethodNotImplemented)
- }
- })
- GeneratedPluginRegistrant.register(with: self)
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
- }
- }
|