capacitor-plugin-vonage 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/managemyhealth/plugin/vonage/VideoCallActivity.java +53 -23
- package/android/src/main/java/com/managemyhealth/plugin/vonage/vonagePlugin.java +0 -0
- package/android/src/main/res/drawable/circle_toast.xml +9 -0
- package/ios/Plugin/VideoChatViewController.swift +58 -27
- package/ios/Plugin/vonagePlugin.swift +0 -3
- package/package.json +1 -1
@@ -50,6 +50,7 @@ import javax.annotation.Nullable;
|
|
50
50
|
import pub.devrel.easypermissions.EasyPermissions;
|
51
51
|
public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks, Application.ActivityLifecycleCallbacks {
|
52
52
|
private static final String TAG = VideoCallActivity.class.getSimpleName();
|
53
|
+
private static Toast GlobalToast;
|
53
54
|
public Session session;
|
54
55
|
private static Bridge staticBridge = null;
|
55
56
|
private String dummyProfile = "https://www.gravatar.com/avatar/?d=mp";
|
@@ -84,6 +85,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
84
85
|
public static Button admit;
|
85
86
|
public static Button deny ;
|
86
87
|
Boolean ISPROVIDER = false;
|
88
|
+
Boolean iscircleAvatarVisible = false;
|
89
|
+
Boolean onVideoDataReceived = false;
|
87
90
|
Boolean isAppinBackground = false;
|
88
91
|
private TextView timerTextView;
|
89
92
|
private long startTime = 0;
|
@@ -173,6 +176,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
173
176
|
ProviderViewLayout.setVisibility(View.VISIBLE);
|
174
177
|
}
|
175
178
|
circleAvatar.setVisibility(View.GONE); // Hide the view
|
179
|
+
iscircleAvatarVisible=false;
|
176
180
|
patientStatus.setVisibility(View.GONE); // Hide the view
|
177
181
|
publishernameView.setVisibility(View.GONE);// Hide the view
|
178
182
|
admit.setVisibility(View.GONE);
|
@@ -200,6 +204,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
200
204
|
ProviderViewLayout.setVisibility(View.VISIBLE);
|
201
205
|
}
|
202
206
|
circleAvatar.setVisibility(View.GONE); // Hide the view
|
207
|
+
iscircleAvatarVisible=false;
|
208
|
+
|
203
209
|
patientStatus.setVisibility(View.GONE); // Hide the view
|
204
210
|
publishernameView.setVisibility(View.GONE);// Hide the view
|
205
211
|
admit.setVisibility(View.GONE);
|
@@ -230,27 +236,33 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
230
236
|
|
231
237
|
}
|
232
238
|
else if( stream.getStreamVideoType()==Stream.StreamVideoType.StreamVideoTypeCamera) {
|
233
|
-
|
234
|
-
publishernameView.setVisibility(View.VISIBLE);
|
239
|
+
|
235
240
|
if (!ISPROVIDER) {
|
236
|
-
if
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
241
|
+
// if(streamCount==1){
|
242
|
+
circleAvatar.setVisibility(View.VISIBLE); // Show the view
|
243
|
+
iscircleAvatarVisible=true;
|
244
|
+
publishernameView.setVisibility(View.VISIBLE);
|
245
|
+
if (session != null) {
|
246
|
+
session.disconnect();
|
247
|
+
}
|
248
|
+
if (subscriber != null) {
|
249
|
+
subscriber = null;
|
250
|
+
subscriberViewContainer.removeAllViews();
|
251
|
+
Intent resultIntent = new Intent();
|
252
|
+
String resultcode = ISPROVIDER ? "999" : "888";
|
253
|
+
resultIntent.putExtra("result_key", resultcode);
|
254
|
+
setResult(RESULT_OK, resultIntent);
|
255
|
+
finish();
|
256
|
+
}
|
257
|
+
// }
|
248
258
|
} else {
|
249
|
-
if
|
250
|
-
subscriber
|
251
|
-
|
252
|
-
|
253
|
-
|
259
|
+
// if(streamCount==1){
|
260
|
+
if (subscriber != null) {
|
261
|
+
subscriber = null;
|
262
|
+
subscriberViewContainer.removeAllViews();
|
263
|
+
showToast(SUBSCRIBERNAME + " left the call");
|
264
|
+
}
|
265
|
+
// }
|
254
266
|
}
|
255
267
|
}
|
256
268
|
}
|
@@ -271,16 +283,27 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
271
283
|
};
|
272
284
|
SubscriberKit.VideoListener videoListener = new SubscriberKit.VideoListener() {
|
273
285
|
@Override
|
274
|
-
public void onVideoDataReceived(SubscriberKit subscriberKit) {
|
286
|
+
public void onVideoDataReceived(SubscriberKit subscriberKit) {
|
287
|
+
onVideoDataReceived=true;
|
288
|
+
}
|
275
289
|
@Override
|
276
290
|
public void onVideoDisabled(SubscriberKit subscriberKit, String s) {
|
291
|
+
|
292
|
+
onVideoDataReceived=false;
|
277
293
|
showToast(SUBSCRIBERNAME + " video disabled");
|
278
294
|
circleAvatar.setVisibility(View.VISIBLE); // Show the view
|
295
|
+
iscircleAvatarVisible=true;
|
296
|
+
|
279
297
|
}
|
280
298
|
@Override
|
281
299
|
public void onVideoEnabled(SubscriberKit subscriberKit, String s) {
|
282
|
-
|
283
|
-
|
300
|
+
Log.d("onVideoEnabled",s);
|
301
|
+
if(s == "publishVideo"){
|
302
|
+
showToast(SUBSCRIBERNAME + " video enabled");
|
303
|
+
circleAvatar.setVisibility(View.GONE); // Hide the view
|
304
|
+
iscircleAvatarVisible = false;
|
305
|
+
}
|
306
|
+
|
284
307
|
}
|
285
308
|
@Override
|
286
309
|
public void onVideoDisableWarning(SubscriberKit subscriberKit) {}
|
@@ -564,6 +587,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
564
587
|
// if(instance.ISPROVIDER){
|
565
588
|
Log.d("patientStatuISPROVIDER", String.valueOf(isOnline));
|
566
589
|
|
590
|
+
if(subscriber==null){
|
567
591
|
runOnUiThread(new Runnable() {
|
568
592
|
@Override
|
569
593
|
public void run() {
|
@@ -592,17 +616,22 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
592
616
|
|
593
617
|
}
|
594
618
|
});
|
619
|
+
}
|
595
620
|
// }
|
596
621
|
}
|
597
622
|
public static void showGreenToast(Context context, String message) {
|
623
|
+
if(GlobalToast!=null){
|
624
|
+
GlobalToast.cancel();
|
625
|
+
}
|
598
626
|
LayoutInflater inflater = LayoutInflater.from(context);
|
599
627
|
View layout = inflater.inflate(R.layout.custom_toast_green_layout, null);
|
628
|
+
|
600
629
|
TextView text = layout.findViewById(R.id.toastView);
|
601
630
|
text.setText(message);
|
602
631
|
Toast toast = new Toast(context);
|
603
632
|
toast.setDuration(Toast.LENGTH_SHORT);
|
604
633
|
toast.setView(layout);
|
605
|
-
toast.setGravity(Gravity.TOP | Gravity.END, 0,
|
634
|
+
toast.setGravity(Gravity.TOP | Gravity.END, 0, 10);
|
606
635
|
int desiredWidth = isTablet(context) ? getScreenWidth(context) - dpToPx(context, 250) :
|
607
636
|
getScreenWidth(context) - dpToPx(context, 100);
|
608
637
|
|
@@ -611,6 +640,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
611
640
|
ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(desiredWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
|
612
641
|
layout.setLayoutParams(params);
|
613
642
|
toast.show();
|
643
|
+
GlobalToast =toast;
|
614
644
|
}
|
615
645
|
private static boolean isTablet(Context context) {
|
616
646
|
return (context.getResources().getConfiguration().screenLayout &
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
3
|
+
<solid android:color="#0B6623" />
|
4
|
+
<corners
|
5
|
+
android:bottomLeftRadius="20dp"
|
6
|
+
android:bottomRightRadius="20dp"
|
7
|
+
android:topLeftRadius="20dp"
|
8
|
+
android:topRightRadius="20dp" />
|
9
|
+
</shape>
|
@@ -26,11 +26,21 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
26
26
|
var isPatientFromWeb = true
|
27
27
|
var videoCallParam = String()
|
28
28
|
var profilePicApiUrl = ""
|
29
|
-
|
30
|
-
var publisher: OTPublisher?
|
29
|
+
// var session: OTSession?
|
30
|
+
//var publisher: OTPublisher?
|
31
31
|
var subscriber: OTSubscriber?
|
32
32
|
var screenTypesubscriber: OTSubscriber?
|
33
33
|
|
34
|
+
lazy var session: OTSession = {
|
35
|
+
return OTSession(apiKey: kApiKey, sessionId: kSessionId, delegate: self)!
|
36
|
+
}()
|
37
|
+
lazy var publisher: OTPublisher = {
|
38
|
+
let settings = OTPublisherSettings()
|
39
|
+
settings.name = UIDevice.current.name
|
40
|
+
return OTPublisher(delegate: self, settings: settings)!
|
41
|
+
}()
|
42
|
+
var error: OTError?
|
43
|
+
|
34
44
|
var bottomView = UIView()
|
35
45
|
var remoteView = UIView()
|
36
46
|
var localView = UIView()
|
@@ -61,6 +71,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
61
71
|
NotificationCenter.default.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
62
72
|
showActivityIndicator()
|
63
73
|
UserDefaults.standard.set(isProvider, forKey: "isProvider")
|
74
|
+
self.connectToAnOpenTokSession()
|
64
75
|
self.viewSetupMethod()
|
65
76
|
// let jsonParam = videoCallParam.toJSON() as? [String:AnyObject] // can be any type here
|
66
77
|
// print(jsonParam as Any)
|
@@ -98,7 +109,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
98
109
|
// NSLog("Unable to change preferred sample rate because : \(String(describing: err?.localizedDescription))")
|
99
110
|
// err = nil
|
100
111
|
// }
|
101
|
-
|
112
|
+
|
102
113
|
// })
|
103
114
|
}
|
104
115
|
override func viewDidAppear(_ animated: Bool) {
|
@@ -223,7 +234,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
223
234
|
|
224
235
|
remoteView = UIView(frame: CGRect(x: 0, y: 0, width: screenWidth, height:screenHeight))
|
225
236
|
remoteView.backgroundColor = .white//UIColor(red: 83/255, green: 83/255, blue: 83/255, alpha: 1.0)
|
226
|
-
centerView.layer.zPosition =
|
237
|
+
centerView.layer.zPosition = 3
|
227
238
|
centerView.frame = CGRect(x: 0, y: 0, width: 250, height: 400)
|
228
239
|
// centerView.backgroundColor = .blue
|
229
240
|
centerView.center.x = remoteView.center.x
|
@@ -284,6 +295,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
284
295
|
adminBtn.layer.borderColor = UIColor(hex: "#60D2A7").cgColor
|
285
296
|
adminBtn.layer.borderWidth = 2
|
286
297
|
adminBtn.layer.cornerRadius = 10
|
298
|
+
adminBtn.layer.zPosition = 3
|
287
299
|
adminBtn.setTitleColor(UIColor(hex: "#000000"), for: .normal)
|
288
300
|
adminBtn.setTitle("ADMIT", for: .normal)
|
289
301
|
adminBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: dynamicFontSize(UIDevice.current.userInterfaceIdiom == .pad ? 10 : 15))
|
@@ -295,6 +307,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
295
307
|
sendNotificationBtn.layer.borderColor = UIColor(hex: "#60D2A7").cgColor
|
296
308
|
sendNotificationBtn.layer.borderWidth = 2
|
297
309
|
sendNotificationBtn.layer.cornerRadius = 10
|
310
|
+
sendNotificationBtn.layer.zPosition = 3
|
298
311
|
sendNotificationBtn.setTitleColor(UIColor(hex: "#000000"), for: .normal)
|
299
312
|
sendNotificationBtn.setTitle(isPatientFromWeb ? "SEND EMAIL NOTIFICATION" : "SEND NOTIFICATION", for: .normal)
|
300
313
|
sendNotificationBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: dynamicFontSize(UIDevice.current.userInterfaceIdiom == .pad ? 7 : 15))
|
@@ -306,6 +319,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
306
319
|
denyBtn.layer.borderColor = UIColor(hex: "#C4CBCF").cgColor
|
307
320
|
denyBtn.layer.borderWidth = 2
|
308
321
|
denyBtn.layer.cornerRadius = 10
|
322
|
+
denyBtn.layer.zPosition = 3
|
309
323
|
denyBtn.setTitleColor(UIColor(hex: "#000000"), for: .normal)
|
310
324
|
denyBtn.setTitle("DENY", for: .normal)
|
311
325
|
denyBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: dynamicFontSize(UIDevice.current.userInterfaceIdiom == .pad ? 10 : 15))
|
@@ -322,7 +336,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
322
336
|
centerView.isHidden = true
|
323
337
|
|
324
338
|
// subscriberImg = UIImageView(image: <#T##UIImage?#>)
|
325
|
-
remoteView.addSubview(centerView)
|
339
|
+
//remoteView.addSubview(centerView)
|
326
340
|
remoteView.addSubview(timerLabel)
|
327
341
|
remoteView.addSubview(subscriberLabel)
|
328
342
|
|
@@ -333,7 +347,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
333
347
|
bottomView.center = CGPoint(x: self.view.frame.size.width / 2, y: self.view.frame.size.height - 50)
|
334
348
|
|
335
349
|
self.view.addSubview(bottomView)
|
336
|
-
|
350
|
+
self.view.addSubview(centerView)
|
337
351
|
localView = UIView(frame: CGRect(x: screenWidth - 140, y: screenHeight - 260, width: 120, height: 120))
|
338
352
|
localView.backgroundColor = UIColor(red: 31/255, green: 33/255, blue: 36/255, alpha: 1.0)
|
339
353
|
localView.layer.borderColor = UIColor(hex: "#9b9c98").cgColor
|
@@ -421,7 +435,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
421
435
|
let userInfo = ["isProvider": isProvider]
|
422
436
|
// NotificationCenter.default.post(name: NSNotification.Name("SendNotification"),object: nil,userInfo: userInfo)
|
423
437
|
delegate?.videoCallSendNotification(userInfo)
|
424
|
-
// self.session
|
438
|
+
// self.session.disconnect(nil)
|
425
439
|
// self.stopTimer()
|
426
440
|
// self.dismiss(animated: true, completion: nil)
|
427
441
|
}
|
@@ -437,7 +451,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
437
451
|
//subscriberStatusLabel.frame.width =
|
438
452
|
// let userInfo = ["userInfo": ["isProvider": isProvider]]
|
439
453
|
// NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.videoEnded),object: nil,userInfo: userInfo)
|
440
|
-
// self.session
|
454
|
+
// self.session.disconnect(nil)
|
441
455
|
// self.stopTimer()
|
442
456
|
// self.dismiss(animated: true, completion: nil)
|
443
457
|
let userInfo = ["isProvider": isProvider]
|
@@ -475,11 +489,11 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
475
489
|
print("A stream was destroyed in the session.")
|
476
490
|
if (self.isBackCameraFace) {
|
477
491
|
print("A stream was destroyed in the session.1")
|
478
|
-
self.publisher
|
492
|
+
self.publisher.cameraPosition = .front
|
479
493
|
self.isBackCameraFace = false
|
480
494
|
} else {
|
481
495
|
print("A stream was destroyed in the session.2")
|
482
|
-
self.publisher
|
496
|
+
self.publisher.cameraPosition = .back
|
483
497
|
self.isBackCameraFace = true
|
484
498
|
}
|
485
499
|
}
|
@@ -489,11 +503,11 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
489
503
|
}
|
490
504
|
func turnOnAndOffVideo(){
|
491
505
|
if (self.isVideoMute) {
|
492
|
-
self.publisher
|
506
|
+
self.publisher.publishVideo = true
|
493
507
|
self.videoBtn.setImage(UIImage(named : "cameraOnWhite"), for: .normal)
|
494
508
|
self.isVideoMute = false
|
495
509
|
} else {
|
496
|
-
self.publisher
|
510
|
+
self.publisher.publishVideo = false
|
497
511
|
self.videoBtn.setImage(UIImage(named:"cameraOff"), for: .normal)
|
498
512
|
self.isVideoMute = true
|
499
513
|
}
|
@@ -502,22 +516,22 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
502
516
|
@objc func audioBtnbuttonClicked() {
|
503
517
|
if (self.isAudioMute) {
|
504
518
|
|
505
|
-
self.publisher
|
519
|
+
self.publisher.publishAudio = true
|
506
520
|
//self.publisher.del
|
507
521
|
self.audioBtn.setImage(UIImage(named : "microphoneOnWhite"), for: .normal)
|
508
522
|
self.isAudioMute = false
|
509
523
|
} else {
|
510
|
-
self.publisher
|
524
|
+
self.publisher.publishAudio = false
|
511
525
|
self.audioBtn.setImage(UIImage(named:"microphoneOff"), for: .normal)
|
512
526
|
self.isAudioMute = true
|
513
527
|
}
|
514
528
|
}
|
515
529
|
|
516
530
|
func connectToAnOpenTokSession() {
|
517
|
-
session = OTSession(apiKey: kApiKey, sessionId: kSessionId, delegate: self)
|
531
|
+
//session = OTSession(apiKey: kApiKey, sessionId: kSessionId, delegate: self)
|
518
532
|
//self.session = session
|
519
533
|
var error: OTError?
|
520
|
-
session
|
534
|
+
session.connect(withToken: kToken, error: &error)
|
521
535
|
if error != nil {
|
522
536
|
print(error!)
|
523
537
|
}
|
@@ -565,7 +579,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
565
579
|
|
566
580
|
func sessionDidDisconnect(_ session: OTSession) {
|
567
581
|
print("The client disconnected from the OpenTok session.")
|
568
|
-
// self.session
|
582
|
+
// self.session.disconnect(nil)
|
569
583
|
// if(!isCallEnded){
|
570
584
|
// let userInfo = ["userInfo": ["isProvider": self.isProvider]]
|
571
585
|
// // NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.videoEnded),object: nil,userInfo: userInfo)
|
@@ -575,6 +589,22 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
575
589
|
}
|
576
590
|
|
577
591
|
func session(_ session: OTSession, didFailWithError error: OTError) {
|
592
|
+
hideActivityIndicator()
|
593
|
+
let alert = UIAlertController(title: "Error", message: "The client failed to connect to the OpenTok session", preferredStyle: .alert)
|
594
|
+
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
|
595
|
+
switch action.style{
|
596
|
+
case .default:
|
597
|
+
print("default")
|
598
|
+
|
599
|
+
case .cancel:
|
600
|
+
print("cancel")
|
601
|
+
|
602
|
+
case .destructive:
|
603
|
+
print("destructive")
|
604
|
+
|
605
|
+
}
|
606
|
+
}))
|
607
|
+
self.present(alert, animated: true, completion: nil)
|
578
608
|
print("The client failed to connect to the OpenTok session: \(error).")
|
579
609
|
}
|
580
610
|
|
@@ -613,8 +643,8 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
613
643
|
print("A stream was destroyed in the session.\(session.sessionId)")
|
614
644
|
// var error = OTError()
|
615
645
|
// let progressPointer = AutoreleasingUnsafeMutablePointer<OTError?>.init(&error)
|
616
|
-
// if(session.sessionId == self.session
|
617
|
-
// self.session
|
646
|
+
// if(session.sessionId == self.session.sessionId){
|
647
|
+
// self.session.disconnect(nil)
|
618
648
|
// self.dismiss(animated: true, completion: nil)
|
619
649
|
// }
|
620
650
|
if let subStream = subscriber?.stream, subStream.streamId == stream.streamId,!isProvider, stream.videoType != .screen {
|
@@ -725,14 +755,14 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
725
755
|
// NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
726
756
|
// DispatchQueue.main.async {
|
727
757
|
print("video ended called")
|
728
|
-
// self.publisher
|
729
|
-
// self.publisher
|
730
|
-
// self.publisher
|
758
|
+
// self.publisher.publishVideo = false
|
759
|
+
// self.publisher.videoCapture?.stop()
|
760
|
+
// self.publisher.publishAudio = false
|
731
761
|
|
732
762
|
// self.cleanupSubscriber()
|
733
763
|
//self.cleanupPublisher()
|
734
764
|
var error: OTError?
|
735
|
-
self.session
|
765
|
+
self.session.disconnect(&error)
|
736
766
|
if error != nil {
|
737
767
|
print(error!)
|
738
768
|
}
|
@@ -745,13 +775,13 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
745
775
|
timerLabel.textColor = .black
|
746
776
|
publisherLabel.textColor = .black
|
747
777
|
subscriber?.view?.removeFromSuperview()
|
748
|
-
subscriber = nil
|
778
|
+
//subscriber = nil
|
749
779
|
remoteView.backgroundColor = .white
|
750
780
|
}
|
751
781
|
|
752
782
|
fileprivate func cleanupPublisher() {
|
753
|
-
publisher
|
754
|
-
publisher = nil
|
783
|
+
publisher.view?.removeFromSuperview()
|
784
|
+
//publisher = nil
|
755
785
|
}
|
756
786
|
func someImageViewConstraints() {
|
757
787
|
subscriberImg.widthAnchor.constraint(equalToConstant: 180).isActive = true
|
@@ -822,12 +852,13 @@ func showToast(message : String) {
|
|
822
852
|
toastLabel.textColor = .white//UIColor.black
|
823
853
|
toastLabel.font = .systemFont(ofSize: 14.0)
|
824
854
|
toastLabel.textAlignment = .center;
|
855
|
+
toastLabel.baselineAdjustment = .alignCenters
|
825
856
|
toastLabel.text = message
|
826
857
|
toastLabel.alpha = 1.0
|
827
858
|
toastLabel.layer.cornerRadius = 10;
|
828
859
|
toastLabel.clipsToBounds = true
|
829
860
|
self.view.addSubview(toastLabel)
|
830
|
-
UIView.animate(withDuration:
|
861
|
+
UIView.animate(withDuration: 4.0, delay: 0.2, options: .curveEaseOut, animations: {
|
831
862
|
toastLabel.alpha = 0.0
|
832
863
|
}, completion: {(isCompleted) in
|
833
864
|
toastLabel.removeFromSuperview()
|
@@ -12,9 +12,6 @@ public class vonagePlugin: CAPPlugin,VonageSDKInteractionDelegate {
|
|
12
12
|
let sessionId = call.getString("sessionId") ?? ""
|
13
13
|
let apiKey = call.getString("apiKey") ?? ""
|
14
14
|
let token = call.getString("token") ?? ""
|
15
|
-
print("token: \(token)")
|
16
|
-
print("apiKey: \(apiKey)")
|
17
|
-
print("sessionId: \(sessionId)")
|
18
15
|
let publisherName = call.getString("publisherName") ?? ""
|
19
16
|
let subscriberName = call.getString("subscriberName") ?? ""
|
20
17
|
let isProvider = call.getBool("isProvider") ?? false //profilePicApiUrl
|