capacitor-plugin-vonage 0.1.3 → 0.1.5
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/CapacitorPluginVonage.podspec +1 -0
- package/README.md +16 -0
- package/android/src/main/java/com/managemyhealth/plugin/vonage/VideoCallActivity.java +246 -45
- package/android/src/main/java/com/managemyhealth/plugin/vonage/vonagePlugin.java +31 -4
- package/android/src/main/res/drawable/circle_shape.xml +8 -8
- package/android/src/main/res/layout/custom_dialog_layout.xml +54 -0
- package/android/src/main/res/layout/custom_toast_green_layout.xml +1 -2
- package/android/src/main/res/layout/video_call_layout.xml +5 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/dist/docs.json +18 -0
- package/dist/esm/definitions.d.ts +3 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +5 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +5 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +5 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CustomAlertViewController.swift +77 -0
- package/ios/Plugin/CustomAlertViewController.xib +137 -0
- package/ios/Plugin/VideoChatViewController.swift +38 -14
- package/ios/Plugin/vonagePlugin.m +1 -0
- package/ios/Plugin/vonagePlugin.swift +14 -1
- package/package.json +1 -1
@@ -11,6 +11,7 @@ Pod::Spec.new do |s|
|
|
11
11
|
s.author = package['author']
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
14
|
+
s.resources = "ios/Plugin/**/*.{xib}"
|
14
15
|
s.ios.deployment_target = '13.0'
|
15
16
|
s.dependency 'Capacitor'
|
16
17
|
#s.dependency 'OpenTok','2.25.0'
|
package/README.md
CHANGED
@@ -17,6 +17,7 @@ npx cap sync
|
|
17
17
|
* [`openVideoCallWindow(...)`](#openvideocallwindow)
|
18
18
|
* [`endVideoCall()`](#endvideocall)
|
19
19
|
* [`setPatientOnlineStatus(...)`](#setpatientonlinestatus)
|
20
|
+
* [`setSendNotificationStatus(...)`](#setsendnotificationstatus)
|
20
21
|
* [`addListener([eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void], ...)`](#addlistenereventname-videocallended-listenerfunc-info-any--void--eventname-sendnotification-listenerfunc-info-any--void--eventname-videocallstarted-listenerfunc-info-any--void)
|
21
22
|
* [Interfaces](#interfaces)
|
22
23
|
* [Type Aliases](#type-aliases)
|
@@ -82,6 +83,21 @@ setPatientOnlineStatus(options: Object) => Promise<{ value: any; }>
|
|
82
83
|
--------------------
|
83
84
|
|
84
85
|
|
86
|
+
### setSendNotificationStatus(...)
|
87
|
+
|
88
|
+
```typescript
|
89
|
+
setSendNotificationStatus(options: Object) => Promise<{ value: any; }>
|
90
|
+
```
|
91
|
+
|
92
|
+
| Param | Type |
|
93
|
+
| ------------- | ----------------------------------------- |
|
94
|
+
| **`options`** | <code><a href="#object">Object</a></code> |
|
95
|
+
|
96
|
+
**Returns:** <code>Promise<{ value: any; }></code>
|
97
|
+
|
98
|
+
--------------------
|
99
|
+
|
100
|
+
|
85
101
|
### addListener([eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void], ...)
|
86
102
|
|
87
103
|
```typescript
|
@@ -3,19 +3,28 @@ package com.managemyhealth.plugin.vonage;
|
|
3
3
|
|
4
4
|
|
5
5
|
import android.annotation.SuppressLint;
|
6
|
+
import android.app.Activity;
|
7
|
+
import android.app.AlertDialog;
|
8
|
+
import android.app.Application;
|
6
9
|
import android.content.Context;
|
10
|
+
import android.graphics.Color;
|
11
|
+
import android.graphics.drawable.ColorDrawable;
|
12
|
+
import android.graphics.drawable.GradientDrawable;
|
7
13
|
import android.os.AsyncTask;
|
8
14
|
import android.app.ActionBar;
|
9
15
|
import android.content.Intent;
|
10
16
|
import android.graphics.Bitmap;
|
11
17
|
import android.graphics.BitmapFactory;
|
12
18
|
import android.opengl.GLSurfaceView;
|
19
|
+
import android.os.Build;
|
13
20
|
import android.os.Bundle;
|
14
21
|
import android.os.Handler;
|
22
|
+
import android.util.DisplayMetrics;
|
15
23
|
import android.util.Log;
|
16
24
|
import android.view.Gravity;
|
17
25
|
import android.view.LayoutInflater;
|
18
26
|
import android.view.View;
|
27
|
+
import android.view.ViewGroup;
|
19
28
|
import android.widget.Button;
|
20
29
|
import android.widget.FrameLayout;
|
21
30
|
import android.widget.ImageView;
|
@@ -26,6 +35,7 @@ import android.widget.Toast;
|
|
26
35
|
import androidx.annotation.NonNull;
|
27
36
|
import androidx.appcompat.app.AppCompatActivity;
|
28
37
|
import com.getcapacitor.Bridge;
|
38
|
+
import com.google.android.gms.common.api.internal.LifecycleActivity;
|
29
39
|
import com.opentok.android.BaseVideoRenderer;
|
30
40
|
import com.opentok.android.OpentokError;
|
31
41
|
import com.opentok.android.Publisher;
|
@@ -38,7 +48,7 @@ import java.io.InputStream;
|
|
38
48
|
import java.util.List;
|
39
49
|
import javax.annotation.Nullable;
|
40
50
|
import pub.devrel.easypermissions.EasyPermissions;
|
41
|
-
public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks{
|
51
|
+
public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks, Application.ActivityLifecycleCallbacks {
|
42
52
|
private static final String TAG = VideoCallActivity.class.getSimpleName();
|
43
53
|
public Session session;
|
44
54
|
private static Bridge staticBridge = null;
|
@@ -61,6 +71,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
61
71
|
private LinearLayout main;
|
62
72
|
private ProgressBar progressBar;
|
63
73
|
private FrameLayout subscriberViewContainer;
|
74
|
+
private FrameLayout subscribersubViewContainer;
|
64
75
|
private TextView publisherNameTextView;
|
65
76
|
private ImageView imageViewEndcall;
|
66
77
|
private ImageView imageViewMute;
|
@@ -73,6 +84,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
73
84
|
public static Button admit;
|
74
85
|
public static Button deny ;
|
75
86
|
Boolean ISPROVIDER = false;
|
87
|
+
Boolean isAppinBackground = false;
|
76
88
|
private TextView timerTextView;
|
77
89
|
private long startTime = 0;
|
78
90
|
|
@@ -147,51 +159,98 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
147
159
|
}
|
148
160
|
@Override
|
149
161
|
public void onStreamReceived(Session session, Stream stream) {
|
150
|
-
|
151
|
-
|
152
|
-
|
162
|
+
stream.getStreamVideoType();
|
163
|
+
Log.d("TYPE===","stream.getStreamVideoType()");
|
164
|
+
Log.d("TYPE===", String.valueOf(stream.getStreamVideoType()));
|
165
|
+
if( stream.getStreamVideoType()==Stream.StreamVideoType.StreamVideoTypeScreen)
|
166
|
+
{
|
167
|
+
subscribersubViewContainer.setVisibility(View.VISIBLE);
|
168
|
+
|
169
|
+
if (subscriber != null) {
|
170
|
+
subscriber = null;}
|
171
|
+
ProviderViewLayout = findViewById(R.id.providerViewLayout);
|
172
|
+
if (ISPROVIDER) {
|
173
|
+
ProviderViewLayout.setVisibility(View.VISIBLE);
|
174
|
+
}
|
175
|
+
circleAvatar.setVisibility(View.GONE); // Hide the view
|
176
|
+
patientStatus.setVisibility(View.GONE); // Hide the view
|
177
|
+
publishernameView.setVisibility(View.GONE);// Hide the view
|
178
|
+
admit.setVisibility(View.GONE);
|
179
|
+
deny.setVisibility(View.GONE);
|
180
|
+
sendNotifications.setVisibility(View.GONE);
|
181
|
+
if (subscriber == null) {
|
182
|
+
subscriber = new Subscriber.Builder(VideoCallActivity.this, stream).build();
|
183
|
+
subscriber.getRenderer().setStyle(BaseVideoRenderer.STYLE_VIDEO_FIT, BaseVideoRenderer.STYLE_VIDEO_FILL);
|
184
|
+
subscriber.setSubscriberListener(subscriberListener);
|
185
|
+
subscriber.setVideoListener(videoListener);
|
186
|
+
session.subscribe(subscriber);
|
187
|
+
try {
|
188
|
+
subscribersubViewContainer.addView(subscriber.getView());
|
189
|
+
} catch (Exception e) {
|
190
|
+
}
|
191
|
+
showToast(SUBSCRIBERNAME + " joined the call");
|
192
|
+
}
|
153
193
|
}
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
194
|
+
else if( stream.getStreamVideoType()==Stream.StreamVideoType.StreamVideoTypeCamera)
|
195
|
+
{
|
196
|
+
if (subscriber != null) {
|
197
|
+
subscriber = null;}
|
198
|
+
ProviderViewLayout = findViewById(R.id.providerViewLayout);
|
199
|
+
if (ISPROVIDER) {
|
200
|
+
ProviderViewLayout.setVisibility(View.VISIBLE);
|
201
|
+
}
|
202
|
+
circleAvatar.setVisibility(View.GONE); // Hide the view
|
203
|
+
patientStatus.setVisibility(View.GONE); // Hide the view
|
204
|
+
publishernameView.setVisibility(View.GONE);// Hide the view
|
205
|
+
admit.setVisibility(View.GONE);
|
206
|
+
deny.setVisibility(View.GONE);
|
207
|
+
sendNotifications.setVisibility(View.GONE);
|
208
|
+
if (subscriber == null) {
|
209
|
+
subscriber = new Subscriber.Builder(VideoCallActivity.this, stream).build();
|
210
|
+
subscriber.getRenderer().setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL);
|
211
|
+
subscriber.setSubscriberListener(subscriberListener);
|
212
|
+
subscriber.setVideoListener(videoListener);
|
213
|
+
session.subscribe(subscriber);
|
214
|
+
try {
|
215
|
+
subscriberViewContainer.addView(subscriber.getView());
|
216
|
+
} catch (Exception e) {
|
217
|
+
}
|
218
|
+
showToast(SUBSCRIBERNAME + " joined the call");
|
219
|
+
}
|
170
220
|
}
|
171
221
|
}
|
172
222
|
@Override
|
173
223
|
public void onStreamDropped(Session session, Stream stream) {
|
174
|
-
|
175
|
-
|
224
|
+
Log.d("onStreamDropped","stream.getStreamVideoType()");
|
225
|
+
Log.d("onStreamDropped", String.valueOf(stream.getStreamVideoType()));
|
176
226
|
|
177
|
-
if(
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
227
|
+
if( stream.getStreamVideoType()==Stream.StreamVideoType.StreamVideoTypeScreen){
|
228
|
+
subscribersubViewContainer.removeAllViews();
|
229
|
+
subscribersubViewContainer.setVisibility(View.GONE);
|
230
|
+
|
231
|
+
}
|
232
|
+
else if( stream.getStreamVideoType()==Stream.StreamVideoType.StreamVideoTypeCamera) {
|
233
|
+
circleAvatar.setVisibility(View.VISIBLE); // Show the view
|
234
|
+
publishernameView.setVisibility(View.VISIBLE);
|
235
|
+
if (!ISPROVIDER) {
|
236
|
+
if (session != null) {
|
237
|
+
session.disconnect();
|
238
|
+
}
|
239
|
+
if (subscriber != null) {
|
240
|
+
subscriber = null;
|
241
|
+
subscriberViewContainer.removeAllViews();
|
242
|
+
Intent resultIntent = new Intent();
|
243
|
+
String resultcode = ISPROVIDER ? "999" : "888";
|
244
|
+
resultIntent.putExtra("result_key", resultcode);
|
245
|
+
setResult(RESULT_OK, resultIntent);
|
246
|
+
finish();
|
247
|
+
}
|
248
|
+
} else {
|
249
|
+
if (subscriber != null) {
|
250
|
+
subscriber = null;
|
251
|
+
subscriberViewContainer.removeAllViews();
|
252
|
+
showToast(SUBSCRIBERNAME + " left the call");
|
253
|
+
}
|
195
254
|
}
|
196
255
|
}
|
197
256
|
}
|
@@ -199,6 +258,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
199
258
|
public void onError(Session session, OpentokError opentokError) {
|
200
259
|
finishWithMessage("Session error: " + opentokError.getMessage());
|
201
260
|
}
|
261
|
+
|
202
262
|
};
|
203
263
|
SubscriberKit.AudioStatsListener aaa = new SubscriberKit.AudioStatsListener(){
|
204
264
|
@Override
|
@@ -264,6 +324,9 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
264
324
|
Intent intent = getIntent();
|
265
325
|
super.onCreate(savedInstanceState);
|
266
326
|
instance = new VideoCallActivity();
|
327
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
328
|
+
registerActivityLifecycleCallbacks(this);
|
329
|
+
}
|
267
330
|
setContentView(R.layout.video_call_layout);
|
268
331
|
sendNotifications = findViewById(R.id.senddata);
|
269
332
|
main = findViewById(R.id.main);
|
@@ -288,6 +351,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
288
351
|
ISPROVIDER = intent.getBooleanExtra("isProvider",false);
|
289
352
|
publisherViewContainer = findViewById(R.id.publisher_container);
|
290
353
|
subscriberViewContainer = findViewById(R.id.subscriber_container);
|
354
|
+
subscribersubViewContainer = findViewById(R.id.subscriber_subcontainer);
|
355
|
+
subscribersubViewContainer.setVisibility(View.GONE);
|
291
356
|
publisherNameTextView = findViewById(R.id.publisherName);
|
292
357
|
publishernameView = findViewById(R.id.publisherNameView);
|
293
358
|
TextView subscriberNameTextView = findViewById(R.id.subscriberName);
|
@@ -332,6 +397,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
332
397
|
public void onClick(View v) {
|
333
398
|
notifyObservers("send");
|
334
399
|
sendNotifications.setVisibility(View.GONE);
|
400
|
+
// showToast("Notification has been sent");
|
335
401
|
}
|
336
402
|
});
|
337
403
|
admit.setOnClickListener(new View.OnClickListener() {
|
@@ -348,10 +414,11 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
348
414
|
deny.setOnClickListener(new View.OnClickListener() {
|
349
415
|
@Override
|
350
416
|
public void onClick(View v) {
|
351
|
-
notifyObservers("deny");
|
352
|
-
session.disconnect();
|
353
|
-
admit.setVisibility(View.GONE);
|
354
|
-
deny.setVisibility(View.GONE);
|
417
|
+
// notifyObservers("deny");
|
418
|
+
// session.disconnect();
|
419
|
+
// admit.setVisibility(View.GONE);
|
420
|
+
// deny.setVisibility(View.GONE);
|
421
|
+
showCustomAlertDialog();
|
355
422
|
}
|
356
423
|
});
|
357
424
|
imageViewEndcall.setOnClickListener(new View.OnClickListener() {
|
@@ -466,7 +533,11 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
466
533
|
}
|
467
534
|
|
468
535
|
|
469
|
-
private void showToast(String message) {
|
536
|
+
private void showToast(String message) {
|
537
|
+
if(!isAppinBackground){
|
538
|
+
showGreenToast(getApplicationContext(), message);
|
539
|
+
}
|
540
|
+
}
|
470
541
|
private void finishWithMessage(String message) {
|
471
542
|
Log.e(TAG, message);
|
472
543
|
if(session!=null){
|
@@ -479,6 +550,11 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
479
550
|
this.finish();
|
480
551
|
}
|
481
552
|
|
553
|
+
public void showSentEmailtoast(Boolean isSuccess) {
|
554
|
+
if(isSuccess){
|
555
|
+
showToast("Notification has been sent");
|
556
|
+
}
|
557
|
+
}
|
482
558
|
public void patientStatusChanged(Boolean isOnline) {
|
483
559
|
Log.d("patientStatusChanged", String.valueOf(isOnline));
|
484
560
|
Log.d("patientStatusChanged2", String.valueOf(isOnline));
|
@@ -527,14 +603,72 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
527
603
|
toast.setDuration(Toast.LENGTH_SHORT);
|
528
604
|
toast.setView(layout);
|
529
605
|
toast.setGravity(Gravity.TOP | Gravity.END, 0, 0);
|
606
|
+
int desiredWidth = isTablet(context) ? getScreenWidth(context) - dpToPx(context, 250) :
|
607
|
+
getScreenWidth(context) - dpToPx(context, 100);
|
608
|
+
|
609
|
+
// Set the width of the Toast
|
610
|
+
toast.setMargin(0, 0);
|
611
|
+
ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(desiredWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
|
612
|
+
layout.setLayoutParams(params);
|
530
613
|
toast.show();
|
531
614
|
}
|
615
|
+
private static boolean isTablet(Context context) {
|
616
|
+
return (context.getResources().getConfiguration().screenLayout &
|
617
|
+
android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK) >=
|
618
|
+
android.content.res.Configuration.SCREENLAYOUT_SIZE_LARGE;
|
619
|
+
}
|
620
|
+
|
621
|
+
private static int getScreenWidth(Context context) {
|
622
|
+
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
623
|
+
return displayMetrics.widthPixels;
|
624
|
+
}
|
625
|
+
|
626
|
+
private static int dpToPx(Context context, int dp) {
|
627
|
+
float density = context.getResources().getDisplayMetrics().density;
|
628
|
+
return Math.round(dp * density);
|
629
|
+
}
|
532
630
|
|
533
631
|
|
534
632
|
public void notifyObservers(String value) {
|
535
633
|
vonagePlugin temp = new vonagePlugin();
|
536
634
|
temp.update(value);
|
537
635
|
}
|
636
|
+
|
637
|
+
@Override
|
638
|
+
public void onActivityCreated(@NonNull Activity activity, @androidx.annotation.Nullable Bundle bundle) {
|
639
|
+
|
640
|
+
}
|
641
|
+
|
642
|
+
@Override
|
643
|
+
public void onActivityStarted(@NonNull Activity activity) {
|
644
|
+
isAppinBackground= false;
|
645
|
+
}
|
646
|
+
|
647
|
+
@Override
|
648
|
+
public void onActivityResumed(@NonNull Activity activity) {
|
649
|
+
isAppinBackground= false;
|
650
|
+
}
|
651
|
+
|
652
|
+
@Override
|
653
|
+
public void onActivityPaused(@NonNull Activity activity) {
|
654
|
+
isAppinBackground =true;
|
655
|
+
}
|
656
|
+
|
657
|
+
@Override
|
658
|
+
public void onActivityStopped(@NonNull Activity activity) {
|
659
|
+
isAppinBackground= true;
|
660
|
+
}
|
661
|
+
|
662
|
+
@Override
|
663
|
+
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {
|
664
|
+
|
665
|
+
}
|
666
|
+
|
667
|
+
@Override
|
668
|
+
public void onActivityDestroyed(@NonNull Activity activity) {
|
669
|
+
isAppinBackground= true;
|
670
|
+
}
|
671
|
+
|
538
672
|
private class urltoSource extends AsyncTask<String, Void, Bitmap> {
|
539
673
|
ImageView imageView;
|
540
674
|
public urltoSource(ImageView imageView) {
|
@@ -555,4 +689,71 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
555
689
|
imageView.setImageBitmap(result);
|
556
690
|
}
|
557
691
|
}
|
692
|
+
private void showCustomAlertDialog() {
|
693
|
+
// Get the layout inflater
|
694
|
+
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
695
|
+
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
696
|
+
View layout = inflater.inflate(R.layout.custom_dialog_layout, null);
|
697
|
+
|
698
|
+
builder.setView(layout);
|
699
|
+
final AlertDialog customDialog = builder.create();
|
700
|
+
Button yesButton = layout.findViewById(R.id.yesButton);
|
701
|
+
LinearLayout alertLayout = layout.findViewById(R.id.alert);
|
702
|
+
// int backgroundColor = Color.parseColor("#FFFFFF"); // Replace with your desired color
|
703
|
+
// alertLayout.setBackgroundColor(backgroundColor);
|
704
|
+
// float cornerRadius = 20f; // Replace with your desired corner radius
|
705
|
+
|
706
|
+
// Create a GradientDrawable with a solid color and corner radius
|
707
|
+
// GradientDrawable gradientDrawable = new GradientDrawable();
|
708
|
+
// gradientDrawable.setShape(GradientDrawable.RECTANGLE);
|
709
|
+
// gradientDrawable.setColor(backgroundColor);
|
710
|
+
// gradientDrawable.setCornerRadius(cornerRadius);
|
711
|
+
|
712
|
+
// Set the GradientDrawable as the background
|
713
|
+
// alertLayout.setBackground(gradientDrawable);
|
714
|
+
// float screenWidthPercentage = 0.6f;
|
715
|
+
// float screenHeightPercentage = 0.4f;
|
716
|
+
// int screenWidth = getScreenWidth(getApplicationContext());
|
717
|
+
// int desiredWidth = (int) (screenWidth * screenWidthPercentage);
|
718
|
+
// int screenHeight = getScreenWidth(getApplicationContext());
|
719
|
+
// int desiredHeight = (int) (screenHeight * screenHeightPercentage);
|
720
|
+
// LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
|
721
|
+
// desiredWidth,
|
722
|
+
// desiredHeight
|
723
|
+
// );
|
724
|
+
// alertLayout.setLayoutParams(layoutParams);
|
725
|
+
// GradientDrawable gradientDrawable = new GradientDrawable();
|
726
|
+
// gradientDrawable.setShape(GradientDrawable.RECTANGLE);
|
727
|
+
// gradientDrawable.setColor(Color.WHITE); // Set your desired background color
|
728
|
+
// gradientDrawable.setCornerRadius(16f); // Set your desired corner radius
|
729
|
+
//
|
730
|
+
// // Set the border if needed
|
731
|
+
// gradientDrawable.setStroke(2, Color.BLACK); // Set border width and color
|
732
|
+
//
|
733
|
+
// // Apply the drawable as the background
|
734
|
+
// alertLayout.setBackground(gradientDrawable);
|
735
|
+
yesButton.setOnClickListener(new View.OnClickListener() {
|
736
|
+
@Override
|
737
|
+
public void onClick(View view) {
|
738
|
+
notifyObservers("deny");
|
739
|
+
session.disconnect();
|
740
|
+
admit.setVisibility(View.GONE);
|
741
|
+
deny.setVisibility(View.GONE);
|
742
|
+
// customDialog.dismiss();
|
743
|
+
}
|
744
|
+
});
|
745
|
+
Button noButton = layout.findViewById(R.id.noButton);
|
746
|
+
noButton.setOnClickListener(new View.OnClickListener() {
|
747
|
+
@Override
|
748
|
+
public void onClick(View view) {
|
749
|
+
customDialog.dismiss();
|
750
|
+
}
|
751
|
+
});
|
752
|
+
|
753
|
+
// Show the AlertDialog
|
754
|
+
customDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
755
|
+
|
756
|
+
customDialog.show();
|
757
|
+
customDialog.getWindow().setLayout(800,480);
|
758
|
+
}
|
558
759
|
}
|
@@ -50,8 +50,6 @@ public class vonagePlugin extends Plugin{
|
|
50
50
|
@PluginMethod(returnType = PluginMethod.RETURN_CALLBACK)
|
51
51
|
public void setPatientOnlineStatus(PluginCall call) {
|
52
52
|
final Boolean isOnline = call.getBoolean("isOnline");
|
53
|
-
showLog("isOnline");
|
54
|
-
showLog(isOnline.toString());
|
55
53
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
56
54
|
|
57
55
|
Runnable myRunnable = new Runnable() {
|
@@ -68,6 +66,28 @@ showLog(isOnline.toString());
|
|
68
66
|
};
|
69
67
|
mainHandler.post(myRunnable);
|
70
68
|
|
69
|
+
}
|
70
|
+
|
71
|
+
@PluginMethod(returnType = PluginMethod.RETURN_CALLBACK)
|
72
|
+
public void setSendNotificationStatus(PluginCall call){
|
73
|
+
|
74
|
+
final Boolean isSuccess = call.getBoolean("isSuccess");
|
75
|
+
Handler mainHandler = new Handler(Looper.getMainLooper());
|
76
|
+
|
77
|
+
Runnable myRunnable = new Runnable() {
|
78
|
+
@Override
|
79
|
+
public void run() {
|
80
|
+
try{
|
81
|
+
// VideoCallActivity temp = new VideoCallActivity();
|
82
|
+
VideoCallActivity.instance.showSentEmailtoast(isSuccess);
|
83
|
+
}catch (Exception e){
|
84
|
+
showLog("temp");
|
85
|
+
showLog(e.toString());
|
86
|
+
}
|
87
|
+
}
|
88
|
+
};
|
89
|
+
mainHandler.post(myRunnable);
|
90
|
+
|
71
91
|
}
|
72
92
|
@PluginMethod(returnType = PluginMethod.RETURN_CALLBACK)
|
73
93
|
public void endVideoCall(PluginCall call) {
|
@@ -122,8 +142,15 @@ showLog(isOnline.toString());
|
|
122
142
|
intent.putExtra("isProvider", ISPROVIDER);
|
123
143
|
intent.putExtra("isPatientOnline", isPatientOnline);
|
124
144
|
intent.putExtra("profilePicApiUrl", profilePicApiUrl);
|
125
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
126
|
-
|
145
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);//|Intent.FLAG_ACTIVITY_NEW_TASK
|
146
|
+
try {
|
147
|
+
showLog("try======");
|
148
|
+
showLog(getContext().getPackageName());
|
149
|
+
intent.setClassName(getContext().getPackageName(), "com.managemyhealth.plugin.vonage.VideoCallActivity");
|
150
|
+
}catch (Exception e){
|
151
|
+
showLog("e========");
|
152
|
+
showLog(e.toString());
|
153
|
+
}
|
127
154
|
|
128
155
|
Handler handler = new Handler();
|
129
156
|
int delayMillis = 2000;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</
|
2
|
+
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
3
|
+
<solid android:color="#ffffff" />
|
4
|
+
<corners
|
5
|
+
android:bottomLeftRadius="20dp"
|
6
|
+
android:bottomRightRadius="20dp"
|
7
|
+
android:topLeftRadius="20dp"
|
8
|
+
android:topRightRadius="20dp" />
|
9
|
+
</shape>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<!-- res/layout/custom_dialog_layout.xml -->
|
2
|
+
|
3
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
4
|
+
android:id="@+id/alert"
|
5
|
+
android:layout_width="200dp"
|
6
|
+
android:layout_height="200dp"
|
7
|
+
android:orientation="vertical"
|
8
|
+
android:paddingBottom="15sp"
|
9
|
+
android:paddingTop="10sp"
|
10
|
+
android:background="@drawable/circle_shape"
|
11
|
+
android:gravity="center">
|
12
|
+
|
13
|
+
<TextView
|
14
|
+
android:id="@+id/dialogTitle"
|
15
|
+
android:layout_width="match_parent"
|
16
|
+
android:layout_height="wrap_content"
|
17
|
+
android:gravity="center"
|
18
|
+
android:text="@string/confirm"
|
19
|
+
android:textColor="#000000"
|
20
|
+
android:textSize="18sp"
|
21
|
+
android:textStyle="bold" />
|
22
|
+
|
23
|
+
<TextView
|
24
|
+
android:id="@+id/dialogMessage"
|
25
|
+
android:layout_width="match_parent"
|
26
|
+
android:layout_height="wrap_content"
|
27
|
+
android:textColor="#000000"
|
28
|
+
android:text="@string/deny_the_call"
|
29
|
+
android:layout_marginTop="8dp"
|
30
|
+
android:gravity="center"/>
|
31
|
+
|
32
|
+
<LinearLayout
|
33
|
+
android:layout_width="match_parent"
|
34
|
+
android:layout_height="wrap_content"
|
35
|
+
android:orientation="horizontal"
|
36
|
+
android:gravity="center"
|
37
|
+
android:layout_marginTop="16dp">
|
38
|
+
|
39
|
+
<Button
|
40
|
+
android:id="@+id/yesButton"
|
41
|
+
android:layout_width="80sp"
|
42
|
+
android:layout_height="32sp"
|
43
|
+
android:background="@drawable/button_background"
|
44
|
+
android:text="@string/yes"/>
|
45
|
+
|
46
|
+
<Button
|
47
|
+
android:id="@+id/noButton"
|
48
|
+
android:layout_width="80sp"
|
49
|
+
android:layout_height="32sp"
|
50
|
+
android:background="@drawable/button_background"
|
51
|
+
android:text="@string/no"
|
52
|
+
android:layout_marginStart="8dp"/>
|
53
|
+
</LinearLayout>
|
54
|
+
</LinearLayout>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
android:layout_width="wrap_content"
|
5
5
|
android:layout_height="wrap_content"
|
6
6
|
android:orientation="vertical"
|
7
|
-
android:padding="
|
7
|
+
android:padding="16dp"
|
8
8
|
android:background="#0B6623">
|
9
9
|
|
10
10
|
<TextView
|
@@ -12,7 +12,6 @@
|
|
12
12
|
android:layout_width="wrap_content"
|
13
13
|
android:layout_height="wrap_content"
|
14
14
|
android:text="Custom Toast"
|
15
|
-
android:textSize="11sp"
|
16
15
|
android:textColor="#FFFFFF"
|
17
16
|
android:textStyle="bold"
|
18
17
|
android:layout_gravity="center_horizontal"/>
|
@@ -53,6 +53,11 @@
|
|
53
53
|
android:layout_width="fill_parent"
|
54
54
|
android:layout_height="match_parent"
|
55
55
|
android:background="#ffffff" />
|
56
|
+
<FrameLayout
|
57
|
+
android:id="@+id/subscriber_subcontainer"
|
58
|
+
android:layout_width="fill_parent"
|
59
|
+
android:layout_height="match_parent"
|
60
|
+
android:background="#ffffff" />
|
56
61
|
|
57
62
|
<TextView
|
58
63
|
android:id="@+id/publisherName"
|
@@ -6,4 +6,8 @@
|
|
6
6
|
<string name="sendvalue">SEND E-MAIL NOTIFICATION</string>
|
7
7
|
<string name="publisher_name">Publisher Name</string>
|
8
8
|
<string name="waiting">WAITING</string>
|
9
|
+
<string name="confirm">Confirm!</string>
|
10
|
+
<string name="deny_the_call">Do you want to deny the call?</string>
|
11
|
+
<string name="yes">Yes</string>
|
12
|
+
<string name="no">No</string>
|
9
13
|
</resources>
|
package/dist/docs.json
CHANGED
@@ -67,6 +67,24 @@
|
|
67
67
|
],
|
68
68
|
"slug": "setpatientonlinestatus"
|
69
69
|
},
|
70
|
+
{
|
71
|
+
"name": "setSendNotificationStatus",
|
72
|
+
"signature": "(options: Object) => Promise<{ value: any; }>",
|
73
|
+
"parameters": [
|
74
|
+
{
|
75
|
+
"name": "options",
|
76
|
+
"docs": "",
|
77
|
+
"type": "Object"
|
78
|
+
}
|
79
|
+
],
|
80
|
+
"returns": "Promise<{ value: any; }>",
|
81
|
+
"tags": [],
|
82
|
+
"docs": "",
|
83
|
+
"complexTypes": [
|
84
|
+
"Object"
|
85
|
+
],
|
86
|
+
"slug": "setsendnotificationstatus"
|
87
|
+
},
|
70
88
|
{
|
71
89
|
"name": "addListener",
|
72
90
|
"signature": "(...args: [eventName: \"VideoCallEnded\", listenerFunc: (info: any) => void] | [eventName: \"SendNotification\", listenerFunc: (info: any) => void] | [eventName: \"VideoCallStarted\", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
@@ -14,5 +14,8 @@ export interface vonagePlugin {
|
|
14
14
|
setPatientOnlineStatus(options: Object): Promise<{
|
15
15
|
value: any;
|
16
16
|
}>;
|
17
|
+
setSendNotificationStatus(options: Object): Promise<{
|
18
|
+
value: any;
|
19
|
+
}>;
|
17
20
|
addListener(...args: [eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;
|
18
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface vonagePlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n openVideoCallWindow(options: Object): Promise<{ value: any }>;\n endVideoCall(): Promise<{ value: string }>;\n setPatientOnlineStatus(options: Object): Promise<{ value: any }>;\n addListener(...args: [eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n}\n"]}
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface vonagePlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n openVideoCallWindow(options: Object): Promise<{ value: any }>;\n endVideoCall(): Promise<{ value: string }>;\n setPatientOnlineStatus(options: Object): Promise<{ value: any }>;\n setSendNotificationStatus(options: Object): Promise<{ value: any }>;\n addListener(...args: [eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
@@ -18,5 +18,10 @@ export class vonageWeb extends WebPlugin {
|
|
18
18
|
console.log('setPatientOnlineStatus', options);
|
19
19
|
return dummyValue;
|
20
20
|
}
|
21
|
+
async setSendNotificationStatus(options) {
|
22
|
+
let dummyValue;
|
23
|
+
console.log('notificationSent', options);
|
24
|
+
return dummyValue;
|
25
|
+
}
|
21
26
|
}
|
22
27
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC,YAAY;QACV,IAAI,UAAc,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,OAAe;QACvC,IAAI,UAAc,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,sBAAsB,CAAC,OAAe;QAC1C,IAAI,UAAc,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { vonagePlugin } from './definitions';\n\nexport class vonageWeb extends WebPlugin implements vonagePlugin {\n endVideoCall(): Promise<{ value: string; }> {\n let dummyValue:any;\n return dummyValue;\n }\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options: Object): Promise<{ value: any }>{\n let dummyValue:any;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options: Object): Promise<{ value: any }>{\n let dummyValue:any;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC,YAAY;QACV,IAAI,UAAc,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,OAAe;QACvC,IAAI,UAAc,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,sBAAsB,CAAC,OAAe;QAC1C,IAAI,UAAc,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,KAAK,CAAC,yBAAyB,CAAC,OAAe;QAC7C,IAAI,UAAc,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACzC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { vonagePlugin } from './definitions';\n\nexport class vonageWeb extends WebPlugin implements vonagePlugin {\n endVideoCall(): Promise<{ value: string; }> {\n let dummyValue:any;\n return dummyValue;\n }\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options: Object): Promise<{ value: any }>{\n let dummyValue:any;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options: Object): Promise<{ value: any }>{\n let dummyValue:any;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n async setSendNotificationStatus(options: Object): Promise<{ value: any }>{\n let dummyValue:any;\n console.log('notificationSent', options);\n return dummyValue;\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
@@ -27,6 +27,11 @@ class vonageWeb extends core.WebPlugin {
|
|
27
27
|
console.log('setPatientOnlineStatus', options);
|
28
28
|
return dummyValue;
|
29
29
|
}
|
30
|
+
async setSendNotificationStatus(options) {
|
31
|
+
let dummyValue;
|
32
|
+
console.log('notificationSent', options);
|
33
|
+
return dummyValue;
|
34
|
+
}
|
30
35
|
}
|
31
36
|
|
32
37
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst vonage = registerPlugin('vonage', {\n web: () => import('./web').then(m => new m.vonageWeb()),\n});\nexport * from './definitions';\nexport { vonage };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class vonageWeb extends WebPlugin {\n endVideoCall() {\n let dummyValue;\n return dummyValue;\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options) {\n let dummyValue;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options) {\n let dummyValue;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACFM,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,YAAY,GAAG;AACnB,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;AACvC,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACpD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,IAAI,MAAM,sBAAsB,CAAC,OAAO,EAAE;AAC1C,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;AACvD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst vonage = registerPlugin('vonage', {\n web: () => import('./web').then(m => new m.vonageWeb()),\n});\nexport * from './definitions';\nexport { vonage };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class vonageWeb extends WebPlugin {\n endVideoCall() {\n let dummyValue;\n return dummyValue;\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options) {\n let dummyValue;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options) {\n let dummyValue;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n async setSendNotificationStatus(options) {\n let dummyValue;\n console.log('notificationSent', options);\n return dummyValue;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACFM,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,YAAY,GAAG;AACnB,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;AACvC,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACpD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,IAAI,MAAM,sBAAsB,CAAC,OAAO,EAAE;AAC1C,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;AACvD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,IAAI,MAAM,yBAAyB,CAAC,OAAO,EAAE;AAC7C,QAAQ,IAAI,UAAU,CAAC;AACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AACjD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
@@ -24,6 +24,11 @@ var capacitorvonage = (function (exports, core) {
|
|
24
24
|
console.log('setPatientOnlineStatus', options);
|
25
25
|
return dummyValue;
|
26
26
|
}
|
27
|
+
async setSendNotificationStatus(options) {
|
28
|
+
let dummyValue;
|
29
|
+
console.log('notificationSent', options);
|
30
|
+
return dummyValue;
|
31
|
+
}
|
27
32
|
}
|
28
33
|
|
29
34
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst vonage = registerPlugin('vonage', {\n web: () => import('./web').then(m => new m.vonageWeb()),\n});\nexport * from './definitions';\nexport { vonage };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class vonageWeb extends WebPlugin {\n endVideoCall() {\n let dummyValue;\n return dummyValue;\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options) {\n let dummyValue;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options) {\n let dummyValue;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICFM,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,YAAY,GAAG;IACnB,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;IACvC,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IACpD,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL,IAAI,MAAM,sBAAsB,CAAC,OAAO,EAAE;IAC1C,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IACvD,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst vonage = registerPlugin('vonage', {\n web: () => import('./web').then(m => new m.vonageWeb()),\n});\nexport * from './definitions';\nexport { vonage };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class vonageWeb extends WebPlugin {\n endVideoCall() {\n let dummyValue;\n return dummyValue;\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async openVideoCallWindow(options) {\n let dummyValue;\n console.log('openVideoCallWindow', options);\n return dummyValue;\n }\n async setPatientOnlineStatus(options) {\n let dummyValue;\n console.log('setPatientOnlineStatus', options);\n return dummyValue;\n }\n async setSendNotificationStatus(options) {\n let dummyValue;\n console.log('notificationSent', options);\n return dummyValue;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICFM,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,YAAY,GAAG;IACnB,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;IACvC,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IACpD,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL,IAAI,MAAM,sBAAsB,CAAC,OAAO,EAAE;IAC1C,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IACvD,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL,IAAI,MAAM,yBAAyB,CAAC,OAAO,EAAE;IAC7C,QAAQ,IAAI,UAAU,CAAC;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACjD,QAAQ,OAAO,UAAU,CAAC;IAC1B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
//
|
2
|
+
// CustomAlertViewController.swift
|
3
|
+
// Plugin
|
4
|
+
//
|
5
|
+
// Created by inlusr1 on 13/01/24.
|
6
|
+
// Copyright © 2024 Max Lynch. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import UIKit
|
10
|
+
|
11
|
+
class CustomAlertViewController: UIViewController {
|
12
|
+
@IBOutlet weak var btn_No: UIButton!
|
13
|
+
|
14
|
+
@IBOutlet weak var btn_Yes: UIButton!
|
15
|
+
|
16
|
+
@IBOutlet weak var contentView: UIView!
|
17
|
+
|
18
|
+
weak var delegate:CustomeAlertDelegate?
|
19
|
+
override func viewDidLoad() {
|
20
|
+
super.viewDidLoad()
|
21
|
+
btn_No.backgroundColor = UIColor(hex: "#DFF6ED")
|
22
|
+
btn_No.layer.borderColor = UIColor(hex: "#60D2A7").cgColor
|
23
|
+
btn_No.layer.borderWidth = 2
|
24
|
+
btn_No.layer.cornerRadius = 10
|
25
|
+
|
26
|
+
btn_Yes.backgroundColor = UIColor(hex: "#DFF6ED")
|
27
|
+
btn_Yes.layer.borderColor = UIColor(hex: "#60D2A7").cgColor
|
28
|
+
btn_Yes.layer.borderWidth = 2
|
29
|
+
btn_Yes.layer.cornerRadius = 10
|
30
|
+
|
31
|
+
contentView.layer.cornerRadius = 10
|
32
|
+
// Do any additional setup after loading the view.
|
33
|
+
}
|
34
|
+
required init?(coder aDecoder: NSCoder) {
|
35
|
+
super.init(coder: aDecoder)
|
36
|
+
|
37
|
+
}
|
38
|
+
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
39
|
+
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
40
|
+
}
|
41
|
+
func show() {
|
42
|
+
if #available(iOS 13, *) {
|
43
|
+
UIApplication.shared.windows.first?.rootViewController?.present(self, animated: true, completion: nil)
|
44
|
+
} else {
|
45
|
+
UIApplication.shared.keyWindow?.rootViewController!.present(self, animated: true, completion: nil)
|
46
|
+
}
|
47
|
+
}
|
48
|
+
@IBAction func yesBtnAction(_ sender: UIButton) {
|
49
|
+
|
50
|
+
self.dismiss(animated: true, completion: nil)
|
51
|
+
delegate?.btnYesClicked()
|
52
|
+
}
|
53
|
+
@IBAction func noBtnAction(_ sender: UIButton) {
|
54
|
+
self.dismiss(animated: true, completion: nil)
|
55
|
+
}
|
56
|
+
/*
|
57
|
+
// MARK: - Navigation
|
58
|
+
|
59
|
+
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
60
|
+
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
61
|
+
// Get the new view controller using segue.destination.
|
62
|
+
// Pass the selected object to the new view controller.
|
63
|
+
}
|
64
|
+
*/
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
//
|
69
|
+
//extension UIViewController {
|
70
|
+
// static func loadFromNib() -> Self {
|
71
|
+
// func instantiateFromNib<T: UIViewController>() -> T {
|
72
|
+
// return T.init(nibName: String(describing: T.self), bundle: Bundle(for: ViewController.self))
|
73
|
+
// }
|
74
|
+
//
|
75
|
+
// return instantiateFromNib()
|
76
|
+
// }
|
77
|
+
//}
|
@@ -0,0 +1,137 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
3
|
+
<device id="retina6_7" orientation="portrait" appearance="light"/>
|
4
|
+
<dependencies>
|
5
|
+
<deployment identifier="iOS"/>
|
6
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
|
7
|
+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
8
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
9
|
+
</dependencies>
|
10
|
+
<objects>
|
11
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomAlertViewController" customModule="CapacitorPluginVonage" customModuleProvider="target">
|
12
|
+
<connections>
|
13
|
+
<outlet property="btn_No" destination="wz9-fV-46s" id="MVg-5t-NXE"/>
|
14
|
+
<outlet property="btn_Yes" destination="jzr-5X-R4L" id="MjZ-q3-JnG"/>
|
15
|
+
<outlet property="contentView" destination="LkS-9N-XT8" id="YnN-a1-JQS"/>
|
16
|
+
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
17
|
+
</connections>
|
18
|
+
</placeholder>
|
19
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
20
|
+
<view contentMode="scaleToFill" id="i5M-Pr-FkT">
|
21
|
+
<rect key="frame" x="0.0" y="0.0" width="428" height="926"/>
|
22
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
23
|
+
<subviews>
|
24
|
+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LkS-9N-XT8">
|
25
|
+
<rect key="frame" x="40" y="388" width="348" height="150"/>
|
26
|
+
<subviews>
|
27
|
+
<label opaque="NO" clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Confirm" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R4h-qn-drL">
|
28
|
+
<rect key="frame" x="0.0" y="9.9999999999999982" width="348" height="19.333333333333329"/>
|
29
|
+
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
30
|
+
<nil key="textColor"/>
|
31
|
+
<variation key="heightClass=regular-widthClass=regular">
|
32
|
+
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
|
33
|
+
</variation>
|
34
|
+
</label>
|
35
|
+
<label opaque="NO" clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Do you want to deny the call?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Je5-qG-cBv">
|
36
|
+
<rect key="frame" x="0.0" y="39.333333333333314" width="348" height="19.333333333333329"/>
|
37
|
+
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
38
|
+
<nil key="textColor"/>
|
39
|
+
<nil key="highlightedColor"/>
|
40
|
+
<variation key="heightClass=regular-widthClass=regular">
|
41
|
+
<fontDescription key="fontDescription" type="system" pointSize="20"/>
|
42
|
+
</variation>
|
43
|
+
</label>
|
44
|
+
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="lCt-86-zUw">
|
45
|
+
<rect key="frame" x="64" y="90" width="220" height="40"/>
|
46
|
+
<subviews>
|
47
|
+
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jzr-5X-R4L">
|
48
|
+
<rect key="frame" x="0.0" y="0.0" width="100" height="40"/>
|
49
|
+
<color key="backgroundColor" red="0.87450980389999999" green="0.96470588239999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
50
|
+
<constraints>
|
51
|
+
<constraint firstAttribute="width" constant="100" id="63L-aR-5zd"/>
|
52
|
+
<constraint firstAttribute="height" constant="40" id="cbC-tz-4po"/>
|
53
|
+
</constraints>
|
54
|
+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
|
55
|
+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
56
|
+
<state key="normal" title="Yes">
|
57
|
+
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
58
|
+
</state>
|
59
|
+
<userDefinedRuntimeAttributes>
|
60
|
+
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderColor">
|
61
|
+
<color key="value" red="0.37647058820000001" green="0.82352941180000006" blue="0.65490196079999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
62
|
+
</userDefinedRuntimeAttribute>
|
63
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
64
|
+
<integer key="value" value="10"/>
|
65
|
+
</userDefinedRuntimeAttribute>
|
66
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
|
67
|
+
<integer key="value" value="2"/>
|
68
|
+
</userDefinedRuntimeAttribute>
|
69
|
+
</userDefinedRuntimeAttributes>
|
70
|
+
<variation key="heightClass=regular-widthClass=regular">
|
71
|
+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
|
72
|
+
</variation>
|
73
|
+
<connections>
|
74
|
+
<action selector="yesBtnAction:" destination="-1" eventType="touchUpInside" id="HRj-ZH-FEW"/>
|
75
|
+
</connections>
|
76
|
+
</button>
|
77
|
+
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wz9-fV-46s">
|
78
|
+
<rect key="frame" x="120" y="0.0" width="100" height="40"/>
|
79
|
+
<color key="backgroundColor" red="0.87450980389999999" green="0.96470588239999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
80
|
+
<constraints>
|
81
|
+
<constraint firstAttribute="width" constant="100" id="HU9-5I-LFZ"/>
|
82
|
+
</constraints>
|
83
|
+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
|
84
|
+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
85
|
+
<state key="normal" title="No">
|
86
|
+
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
87
|
+
</state>
|
88
|
+
<userDefinedRuntimeAttributes>
|
89
|
+
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderColor">
|
90
|
+
<color key="value" red="0.37647058820000001" green="0.82352941180000006" blue="0.65490196079999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
91
|
+
</userDefinedRuntimeAttribute>
|
92
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
93
|
+
<integer key="value" value="10"/>
|
94
|
+
</userDefinedRuntimeAttribute>
|
95
|
+
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
|
96
|
+
<integer key="value" value="2"/>
|
97
|
+
</userDefinedRuntimeAttribute>
|
98
|
+
</userDefinedRuntimeAttributes>
|
99
|
+
<variation key="heightClass=regular-widthClass=regular">
|
100
|
+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
|
101
|
+
</variation>
|
102
|
+
<connections>
|
103
|
+
<action selector="noBtnAction:" destination="-1" eventType="touchUpInside" id="X1y-v7-a1O"/>
|
104
|
+
</connections>
|
105
|
+
</button>
|
106
|
+
</subviews>
|
107
|
+
</stackView>
|
108
|
+
</subviews>
|
109
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
110
|
+
<constraints>
|
111
|
+
<constraint firstAttribute="height" constant="150" id="FbN-U5-psC"/>
|
112
|
+
<constraint firstItem="R4h-qn-drL" firstAttribute="leading" secondItem="LkS-9N-XT8" secondAttribute="leading" id="G0S-ZZ-sIw"/>
|
113
|
+
<constraint firstItem="Je5-qG-cBv" firstAttribute="top" secondItem="R4h-qn-drL" secondAttribute="bottom" constant="10" id="JoU-Ok-Vxj"/>
|
114
|
+
<constraint firstItem="lCt-86-zUw" firstAttribute="centerX" secondItem="LkS-9N-XT8" secondAttribute="centerX" id="MIJ-TW-zHh"/>
|
115
|
+
<constraint firstItem="Je5-qG-cBv" firstAttribute="leading" secondItem="LkS-9N-XT8" secondAttribute="leading" id="SoS-vf-47Q"/>
|
116
|
+
<constraint firstAttribute="trailing" secondItem="R4h-qn-drL" secondAttribute="trailing" id="ZTZ-Ya-N4J"/>
|
117
|
+
<constraint firstItem="R4h-qn-drL" firstAttribute="top" secondItem="LkS-9N-XT8" secondAttribute="top" constant="10" id="cO8-0B-bSw"/>
|
118
|
+
<constraint firstAttribute="bottom" secondItem="lCt-86-zUw" secondAttribute="bottom" constant="20" id="kfL-Or-EC9"/>
|
119
|
+
<constraint firstAttribute="trailing" secondItem="Je5-qG-cBv" secondAttribute="trailing" id="xZy-1U-NYM"/>
|
120
|
+
</constraints>
|
121
|
+
</view>
|
122
|
+
</subviews>
|
123
|
+
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
|
124
|
+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
125
|
+
<constraints>
|
126
|
+
<constraint firstItem="LkS-9N-XT8" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="B9b-ug-PnU">
|
127
|
+
<variation key="heightClass=regular-widthClass=regular" constant="150"/>
|
128
|
+
</constraint>
|
129
|
+
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LkS-9N-XT8" secondAttribute="trailing" constant="40" id="D5r-tA-RV1">
|
130
|
+
<variation key="heightClass=regular-widthClass=regular" constant="150"/>
|
131
|
+
</constraint>
|
132
|
+
<constraint firstItem="LkS-9N-XT8" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="dUH-p8-GhC"/>
|
133
|
+
</constraints>
|
134
|
+
<point key="canvasLocation" x="-5.343511450381679" y="20.422535211267608"/>
|
135
|
+
</view>
|
136
|
+
</objects>
|
137
|
+
</document>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import UIKit
|
9
9
|
import OpenTok
|
10
10
|
|
11
|
-
class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDelegate,OTSubscriberDelegate {
|
11
|
+
class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDelegate,OTSubscriberDelegate,CustomeAlertDelegate {
|
12
12
|
var isCallEnded = false
|
13
13
|
var kApiKey = ""
|
14
14
|
var kSessionId = ""
|
@@ -29,6 +29,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
29
29
|
var session: OTSession?
|
30
30
|
var publisher: OTPublisher?
|
31
31
|
var subscriber: OTSubscriber?
|
32
|
+
var screenTypesubscriber: OTSubscriber?
|
32
33
|
|
33
34
|
var bottomView = UIView()
|
34
35
|
var remoteView = UIView()
|
@@ -105,6 +106,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
105
106
|
super.viewDidAppear(animated)
|
106
107
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
|
107
108
|
NotificationCenter.default.addObserver(self, selector: #selector(setPatientOnlineStatus), name: NSNotification.Name ("PatientOnlineStatus"), object: nil)
|
109
|
+
NotificationCenter.default.addObserver(self, selector: #selector(notificationSent), name: NSNotification.Name ("notificationSent"), object: nil)
|
108
110
|
NotificationCenter.default.addObserver(self,selector:#selector(endVideoCall(_:)),name: NSNotification.Name ("EndVideoCall"),object: nil)
|
109
111
|
|
110
112
|
}
|
@@ -157,6 +159,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
157
159
|
DispatchQueue.main.async {
|
158
160
|
self.patientStatusChanged()
|
159
161
|
}
|
162
|
+
|
160
163
|
// }
|
161
164
|
// if let isOnline = notification.userInfo?["isOnline"] as? Bool , !isCallInProgress {
|
162
165
|
// isPatientOnLine = isOnline
|
@@ -166,6 +169,9 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
166
169
|
// }
|
167
170
|
|
168
171
|
}
|
172
|
+
@objc func notificationSent(_ notification: Notification) {
|
173
|
+
self.showToast(message: "Notification has been sent")
|
174
|
+
}
|
169
175
|
@objc func endVideoCall(_ notification: Notification){
|
170
176
|
print("end video call called")
|
171
177
|
endVonageCall()
|
@@ -440,18 +446,23 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
440
446
|
}
|
441
447
|
@objc func denybuttonClicked() {
|
442
448
|
print("deny button clicked")
|
449
|
+
// centerView.isHidden = true
|
450
|
+
// let userInfo = ["isProvider": isProvider]
|
451
|
+
// delegate?.videoCallEnded(userInfo)
|
452
|
+
// self.endVonageCall()
|
453
|
+
//delegate?.videoCallShowAlert()
|
454
|
+
let customAlert = CustomAlertViewController(nibName: "CustomAlertViewController", bundle: Bundle(for: CustomAlertViewController.self))
|
455
|
+
customAlert.isModalInPresentation = true
|
456
|
+
customAlert.delegate = self
|
457
|
+
customAlert.modalPresentationStyle = .popover
|
458
|
+
self.present(customAlert, animated: true)
|
459
|
+
}
|
460
|
+
func btnYesClicked() {
|
443
461
|
centerView.isHidden = true
|
444
|
-
let userInfo = ["isProvider": isProvider]
|
445
|
-
|
446
|
-
// NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.videoEnded),object: nil,userInfo: userInfo)
|
462
|
+
let userInfo:[String:Any] = ["isProvider": isProvider,"message":"deny"]
|
447
463
|
delegate?.videoCallEnded(userInfo)
|
448
|
-
// self.session?.disconnect(nil)
|
449
|
-
// self.stopTimer()
|
450
|
-
// self.dismiss(animated: true, completion: nil)
|
451
|
-
// NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
452
464
|
self.endVonageCall()
|
453
465
|
}
|
454
|
-
|
455
466
|
@objc func callBtnbuttonClicked() {
|
456
467
|
|
457
468
|
let userInfo = ["isProvider": isProvider]
|
@@ -568,11 +579,11 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
568
579
|
}
|
569
580
|
|
570
581
|
func session(_ session: OTSession, streamCreated stream: OTStream) {
|
571
|
-
subscriber = OTSubscriber(stream: stream, delegate: self)
|
582
|
+
var subscriber = OTSubscriber(stream: stream, delegate: self)
|
572
583
|
guard let subscriber = subscriber else {
|
573
584
|
return
|
574
585
|
}
|
575
|
-
self.subscriber = subscriber
|
586
|
+
//self.subscriber = subscriber
|
576
587
|
var error: OTError?
|
577
588
|
session.subscribe(subscriber, error: &error)
|
578
589
|
guard error == nil else {
|
@@ -588,6 +599,10 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
588
599
|
subscriberView.frame = UIScreen.main.bounds
|
589
600
|
if(stream.videoType == .screen){
|
590
601
|
subscriberView.accessibilityValue = "from screen"
|
602
|
+
subscriber.viewScaleBehavior = .fit
|
603
|
+
self.screenTypesubscriber = subscriber
|
604
|
+
}else{
|
605
|
+
self.subscriber = subscriber
|
591
606
|
}
|
592
607
|
timerLabel.textColor = .white
|
593
608
|
publisherLabel.textColor = .white
|
@@ -627,7 +642,15 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
627
642
|
|
628
643
|
|
629
644
|
}
|
630
|
-
|
645
|
+
func sessionDidBeginReconnecting(_ session:OTSession) {
|
646
|
+
// Display a user interface notification.
|
647
|
+
print("sessionDidBeginReconnecting \(session.sessionId)")
|
648
|
+
}
|
649
|
+
|
650
|
+
func sessionDidReconnect(_ session: OTSession) {
|
651
|
+
// Adjust user interface.
|
652
|
+
print("sessionDidReconnect \(session.sessionId)")
|
653
|
+
}
|
631
654
|
//Publisher methods
|
632
655
|
func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) {
|
633
656
|
print("The publisher failed: \(error)")
|
@@ -792,11 +815,12 @@ extension UIViewController {
|
|
792
815
|
|
793
816
|
func showToast(message : String) {
|
794
817
|
DispatchQueue.main.async {
|
795
|
-
|
818
|
+
let spacing = UIDevice.current.userInterfaceIdiom == .pad ? 250 : 100
|
819
|
+
let toastLabel = UILabel(frame: CGRect(x: spacing, y: 40, width: Int(self.view.frame.size.width) - spacing, height: 50))
|
796
820
|
// toastLabel.center.x = self.view.center.x
|
797
821
|
toastLabel.backgroundColor = UIColor(hex: "#0B6623")//UIColor.white.withAlphaComponent(0.6)
|
798
822
|
toastLabel.textColor = .white//UIColor.black
|
799
|
-
toastLabel.font = .systemFont(ofSize:
|
823
|
+
toastLabel.font = .systemFont(ofSize: 14.0)
|
800
824
|
toastLabel.textAlignment = .center;
|
801
825
|
toastLabel.text = message
|
802
826
|
toastLabel.alpha = 1.0
|
@@ -8,4 +8,5 @@ CAP_PLUGIN(vonagePlugin, "vonage",
|
|
8
8
|
CAP_PLUGIN_METHOD(openVideoCallWindow, CAPPluginReturnPromise);
|
9
9
|
CAP_PLUGIN_METHOD(endVideoCall, CAPPluginReturnPromise);
|
10
10
|
CAP_PLUGIN_METHOD(setPatientOnlineStatus, CAPPluginReturnPromise);
|
11
|
+
CAP_PLUGIN_METHOD(setSendNotificationStatus, CAPPluginReturnPromise);
|
11
12
|
)
|
@@ -12,7 +12,9 @@ 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
|
-
|
15
|
+
print("token: \(token)")
|
16
|
+
print("apiKey: \(apiKey)")
|
17
|
+
print("sessionId: \(sessionId)")
|
16
18
|
let publisherName = call.getString("publisherName") ?? ""
|
17
19
|
let subscriberName = call.getString("subscriberName") ?? ""
|
18
20
|
let isProvider = call.getBool("isProvider") ?? false //profilePicApiUrl
|
@@ -49,6 +51,14 @@ public class vonagePlugin: CAPPlugin,VonageSDKInteractionDelegate {
|
|
49
51
|
|
50
52
|
call.resolve(["value": "setPatientOnlineStatus"])
|
51
53
|
}
|
54
|
+
@objc func setSendNotificationStatus(_ call: CAPPluginCall) {
|
55
|
+
|
56
|
+
let isSuccess = call.getBool("isSuccess") ?? false
|
57
|
+
|
58
|
+
NotificationCenter.default.post(name: NSNotification.Name("notificationSent"),object: nil,userInfo: ["isSuccess":isSuccess])
|
59
|
+
|
60
|
+
call.resolve(["value": "setSendNotificationStatus"])
|
61
|
+
}
|
52
62
|
@objc func endVideoCall(_ call: CAPPluginCall) {
|
53
63
|
NotificationCenter.default.post(name: NSNotification.Name("EndVideoCall"),object: nil,userInfo: nil)
|
54
64
|
call.resolve(["value": "Video call ended."])
|
@@ -106,3 +116,6 @@ func videoCallStarted(_ data: [String: Any])
|
|
106
116
|
func videoCallEnded(_ data: [String: Any])
|
107
117
|
func videoCallSendNotification(_ data: [String: Any])
|
108
118
|
}
|
119
|
+
protocol CustomeAlertDelegate: AnyObject {
|
120
|
+
func btnYesClicked()
|
121
|
+
}
|