add call back fun for end call

merge-requests/147/head
Elham Rababah 6 years ago
parent 9cbc3cfb82
commit 8db2f059ba

@ -13,7 +13,8 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
9CE61EBD24AB366E008D68DD /* ViewControlleraa.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61EBC24AB366E008D68DD /* ViewControlleraa.swift */; }; 9CE61EBD24AB366E008D68DD /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */; };
9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */; };
B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */; }; B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
@ -46,7 +47,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9CE61EBC24AB366E008D68DD /* ViewControlleraa.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControlleraa.swift; sourceTree = "<group>"; }; 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = "<group>"; };
9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = "<group>"; };
9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; }; 9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -115,7 +117,8 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
9CE61EBC24AB366E008D68DD /* ViewControlleraa.swift */, 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */,
9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */,
); );
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
@ -282,8 +285,9 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
9CE61EBD24AB366E008D68DD /* ViewControlleraa.swift in Sources */, 9CE61EBD24AB366E008D68DD /* VideoViewController.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

@ -6,7 +6,15 @@ import OpenTok
// Copyright © 2020 Cloud. All rights reserved. // Copyright © 2020 Cloud. All rights reserved.
@UIApplicationMain @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate ,ICallProtocol {
var result: FlutterResult?
func sessionDone() {
self.result?("Session Done")
}
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
@ -17,7 +25,8 @@ import OpenTok
let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall",
binaryMessenger: controller.binaryMessenger) binaryMessenger: controller.binaryMessenger)
videoCallChannel.setMethodCallHandler({ videoCallChannel.setMethodCallHandler({
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
self.result = result
switch call.method { switch call.method {
case "openVideoCall": case "openVideoCall":
do { do {
@ -37,6 +46,7 @@ import OpenTok
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
private func openVideoChat(result: FlutterResult,kApiKey: String, kSessionId: String,kToken: String,appLang:String) { private func openVideoChat(result: FlutterResult,kApiKey: String, kSessionId: String,kToken: String,appLang:String) {
@ -48,6 +58,7 @@ import OpenTok
videoVC.kApiKey=kApiKey videoVC.kApiKey=kApiKey
videoVC.kSessionId=kSessionId videoVC.kSessionId=kSessionId
videoVC.kToken=kToken videoVC.kToken=kToken
videoVC.callBack = self
videoVC.navigationController?.setNavigationBarHidden(true, animated: false) videoVC.navigationController?.setNavigationBarHidden(true, animated: false)
navVC.modalPresentationStyle = .fullScreen navVC.modalPresentationStyle = .fullScreen
window.rootViewController?.present(navVC, animated: true, completion: nil) window.rootViewController?.present(navVC, animated: true, completion: nil)

@ -0,0 +1,14 @@
//
// ICallProtocol.swift
// Runner
//
// Created by Elham Rababah && Mohammad Aljammal on 7/2/20.
// Copyright © 2020 The Chromium Authors. All rights reserved.
//
import Foundation
protocol ICallProtocol {
func sessionDone()
}

@ -22,6 +22,8 @@ class ViewController: UIViewController {
var kToken:String = "" var kToken:String = ""
var callBack: ICallProtocol?
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
@ -33,7 +35,7 @@ class ViewController: UIViewController {
setupSession() setupSession()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
func setupButtons() { func setupButtons() {
perform(#selector(hideControlButtons), with: nil, afterDelay: 3) perform(#selector(hideControlButtons), with: nil, afterDelay: 3)
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(remoteVideoTapped(_:))) let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(remoteVideoTapped(_:)))
@ -102,6 +104,7 @@ class ViewController: UIViewController {
} }
@IBAction func hangUp(_ sender: UIButton) { @IBAction func hangUp(_ sender: UIButton) {
sessionDisconnect() sessionDisconnect()
} }
@ -110,6 +113,7 @@ class ViewController: UIViewController {
if (session != nil) { if (session != nil) {
print("disconnecting....") print("disconnecting....")
session!.disconnect(nil) session!.disconnect(nil)
callBack?.sessionDone()
dismiss(animated: true) dismiss(animated: true)
return return
} }

@ -101,10 +101,19 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () async {
showCupertinoPicker(
context: context, var asd = await VideoChannel.openVideoCallScreen(
actionList: authProvider.doctorsClinicList); kToken: "T1==cGFydG5lcl9pZD00NjgwMzIyNCZzaWc9ZTUxZGI0NGJiNjhjOGY2YzZkZGVjNTQ0M2Q5ZDJkODY2MjBlYjJjYTpzZXNzaW9uX2lkPTJfTVg0ME5qZ3dNekl5Tkg1LU1UVTVNekEzTkRrMk1qUXhOSDVRZWt3clkxb3lhSGRuYmpWU2FFTmtlbWx2TkZWcWVFSi1mZyZjcmVhdGVfdGltZT0xNTkzMDc1MDA3Jm5vbmNlPTAuNjQ2OTA2MTAwMTU0ODY3NSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNTkzNjc5ODA2JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
kSessionId: '2_MX40NjgwMzIyNH5-MTU5MzA3NDk2MjQxNH5QekwrY1oyaHdnbjVSaENkemlvNFVqeEJ-fg',
kApiKey: '46803224'
);
print(asd);
// showCupertinoPicker(
// context: context,
// actionList: authProvider.doctorsClinicList);
}, },
child: Container( child: Container(
margin: margin:

Loading…
Cancel
Save