capacitor-vonage-plugin 0.0.0-stage → 1.0.1
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/CapacitorVonagePlugin.podspec +21 -0
- package/README.md +169 -2
- package/android/build.gradle +76 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/managemyhealth/plugin/vonage/CustomToastUtils.java +28 -0
- package/android/src/main/java/com/managemyhealth/plugin/vonage/VideoCallActivity.java +791 -0
- package/android/src/main/java/com/managemyhealth/plugin/vonage/vonage.java +11 -0
- package/android/src/main/java/com/managemyhealth/plugin/vonage/vonagePlugin.java +342 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable/button_background.xml +9 -0
- package/android/src/main/res/drawable/button_background2.xml +9 -0
- package/android/src/main/res/drawable/callend.png +0 -0
- package/android/src/main/res/drawable/callstart.png +0 -0
- package/android/src/main/res/drawable/cameraoff.png +0 -0
- package/android/src/main/res/drawable/cameraonwhite.png +0 -0
- package/android/src/main/res/drawable/cameraswitch.png +0 -0
- package/android/src/main/res/drawable/circle_shape.xml +9 -0
- package/android/src/main/res/drawable/circle_toast.xml +9 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable/microphoneoff.png +0 -0
- package/android/src/main/res/drawable/microphoneonwhite.png +0 -0
- package/android/src/main/res/layout/custom_dialog_layout.xml +54 -0
- package/android/src/main/res/layout/custom_toast_green_layout.xml +18 -0
- package/android/src/main/res/layout/video_call_layout.xml +432 -0
- package/android/src/main/res/values/colors.xml +5 -0
- package/android/src/main/res/values/strings.xml +13 -0
- package/android/src/main/res.zip +0 -0
- package/dist/docs.json +416 -0
- package/dist/esm/definitions.d.ts +21 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +22 -0
- package/dist/esm/web.js +36 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +50 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +53 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/CustomAlertViewController.swift +77 -0
- package/ios/Plugin/CustomAlertViewController.xib +137 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/VideoChatViewController.swift +900 -0
- package/ios/Plugin/vonage.swift +8 -0
- package/ios/Plugin/vonagePlugin.h +10 -0
- package/ios/Plugin/vonagePlugin.m +12 -0
- package/ios/Plugin/vonagePlugin.swift +119 -0
- package/package.json +76 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'CapacitorVonagePlugin'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.resources = "ios/Plugin/**/*.{xib}"
|
|
15
|
+
s.ios.deployment_target = '15.0'
|
|
16
|
+
s.dependency 'Capacitor'
|
|
17
|
+
#s.dependency 'OpenTok','2.25.0'
|
|
18
|
+
s.dependency 'OTXCFramework','2.27.0'
|
|
19
|
+
s.swift_version = '5.8'
|
|
20
|
+
s.static_framework = true
|
|
21
|
+
end
|
package/README.md
CHANGED
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
#
|
|
1
|
+
# capacitor-plugin-vonage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
opentok sdk capacitor plugin
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install capacitor-plugin-vonage
|
|
9
|
+
npx cap sync
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
|
+
<docgen-index>
|
|
15
|
+
|
|
16
|
+
* [`echo(...)`](#echo)
|
|
17
|
+
* [`openVideoCallWindow(...)`](#openvideocallwindow)
|
|
18
|
+
* [`endVideoCall()`](#endvideocall)
|
|
19
|
+
* [`setPatientOnlineStatus(...)`](#setpatientonlinestatus)
|
|
20
|
+
* [`setSendNotificationStatus(...)`](#setsendnotificationstatus)
|
|
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-)
|
|
22
|
+
* [Interfaces](#interfaces)
|
|
23
|
+
* [Type Aliases](#type-aliases)
|
|
24
|
+
|
|
25
|
+
</docgen-index>
|
|
26
|
+
|
|
27
|
+
<docgen-api>
|
|
28
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
29
|
+
|
|
30
|
+
### echo(...)
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
echo(options: { value: string; }) => Promise<{ value: string; }>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Param | Type |
|
|
37
|
+
| ------------- | ------------------------------- |
|
|
38
|
+
| **`options`** | <code>{ value: string; }</code> |
|
|
39
|
+
|
|
40
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
41
|
+
|
|
42
|
+
--------------------
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### openVideoCallWindow(...)
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
openVideoCallWindow(options: Object) => Promise<{ value: any; }>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Param | Type |
|
|
52
|
+
| ------------- | ----------------------------------------- |
|
|
53
|
+
| **`options`** | <code><a href="#object">Object</a></code> |
|
|
54
|
+
|
|
55
|
+
**Returns:** <code>Promise<{ value: any; }></code>
|
|
56
|
+
|
|
57
|
+
--------------------
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### endVideoCall()
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
endVideoCall() => Promise<{ value: string; }>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
67
|
+
|
|
68
|
+
--------------------
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### setPatientOnlineStatus(...)
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
setPatientOnlineStatus(options: Object) => Promise<{ value: any; }>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
| Param | Type |
|
|
78
|
+
| ------------- | ----------------------------------------- |
|
|
79
|
+
| **`options`** | <code><a href="#object">Object</a></code> |
|
|
80
|
+
|
|
81
|
+
**Returns:** <code>Promise<{ value: any; }></code>
|
|
82
|
+
|
|
83
|
+
--------------------
|
|
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
|
+
|
|
101
|
+
### addListener([eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] | [eventName: 'SendNotification', listenerFunc: (info: any) => void] | [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void], ...)
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
addListener(...args: [eventName: "VideoCallEnded", listenerFunc: (info: any) => void] | [eventName: "SendNotification", listenerFunc: (info: any) => void] | [eventName: "VideoCallStarted", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
| Param | Type |
|
|
108
|
+
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
109
|
+
| **`args`** | <code>[eventName: 'VideoCallEnded', listenerFunc: (info: any) => void] \| [eventName: 'SendNotification', listenerFunc: (info: any) => void] \| [eventName: 'VideoCallStarted', listenerFunc: (info: any) => void]</code> |
|
|
110
|
+
|
|
111
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>> & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
|
112
|
+
|
|
113
|
+
--------------------
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Interfaces
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
#### Object
|
|
120
|
+
|
|
121
|
+
Provides functionality common to all JavaScript objects.
|
|
122
|
+
|
|
123
|
+
| Prop | Type | Description |
|
|
124
|
+
| ----------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
125
|
+
| **`constructor`** | <code><a href="#function">Function</a></code> | The initial value of <a href="#object">Object</a>.prototype.constructor is the standard built-in <a href="#object">Object</a> constructor. |
|
|
126
|
+
|
|
127
|
+
| Method | Signature | Description |
|
|
128
|
+
| ------------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
129
|
+
| **toString** | () => string | Returns a string representation of an object. |
|
|
130
|
+
| **toLocaleString** | () => string | Returns a date converted to a string using the current locale. |
|
|
131
|
+
| **valueOf** | () => <a href="#object">Object</a> | Returns the primitive value of the specified object. |
|
|
132
|
+
| **hasOwnProperty** | (v: <a href="#propertykey">PropertyKey</a>) => boolean | Determines whether an object has a property with the specified name. |
|
|
133
|
+
| **isPrototypeOf** | (v: <a href="#object">Object</a>) => boolean | Determines whether an object exists in another object's prototype chain. |
|
|
134
|
+
| **propertyIsEnumerable** | (v: <a href="#propertykey">PropertyKey</a>) => boolean | Determines whether a specified property is enumerable. |
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
#### Function
|
|
138
|
+
|
|
139
|
+
Creates a new function.
|
|
140
|
+
|
|
141
|
+
| Prop | Type |
|
|
142
|
+
| --------------- | --------------------------------------------- |
|
|
143
|
+
| **`prototype`** | <code>any</code> |
|
|
144
|
+
| **`length`** | <code>number</code> |
|
|
145
|
+
| **`arguments`** | <code>any</code> |
|
|
146
|
+
| **`caller`** | <code><a href="#function">Function</a></code> |
|
|
147
|
+
|
|
148
|
+
| Method | Signature | Description |
|
|
149
|
+
| ------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
150
|
+
| **apply** | (this: <a href="#function">Function</a>, thisArg: any, argArray?: any) => any | Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. |
|
|
151
|
+
| **call** | (this: <a href="#function">Function</a>, thisArg: any, ...argArray: any[]) => any | Calls a method of an object, substituting another object for the current object. |
|
|
152
|
+
| **bind** | (this: <a href="#function">Function</a>, thisArg: any, ...argArray: any[]) => any | For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters. |
|
|
153
|
+
| **toString** | () => string | Returns a string representation of a function. |
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
#### PluginListenerHandle
|
|
157
|
+
|
|
158
|
+
| Prop | Type |
|
|
159
|
+
| ------------ | ----------------------------------------- |
|
|
160
|
+
| **`remove`** | <code>() => Promise<void></code> |
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Type Aliases
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
#### PropertyKey
|
|
167
|
+
|
|
168
|
+
<code>string | number | symbol</code>
|
|
169
|
+
|
|
170
|
+
</docgen-api>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.0'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.5.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
namespace "com.managemyhealth.plugin.vonage"
|
|
22
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lint {
|
|
37
|
+
abortOnError false
|
|
38
|
+
}
|
|
39
|
+
compileOptions {
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
repositories {
|
|
46
|
+
google()
|
|
47
|
+
mavenCentral()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation 'com.google.android.material:material:1.4.0'
|
|
53
|
+
implementation 'pub.devrel:easypermissions:3.0.0'
|
|
54
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
55
|
+
implementation project(':capacitor-android')
|
|
56
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
57
|
+
implementation 'com.google.android.gms:play-services-cast-framework:21.3.0'
|
|
58
|
+
testImplementation "junit:junit:$junitVersion"
|
|
59
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
60
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
61
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
62
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
63
|
+
implementation 'androidx.annotation:annotation:1.7.0'
|
|
64
|
+
implementation 'com.opentok.android:opentok-android-sdk:2.26.2'
|
|
65
|
+
androidTestImplementation 'androidx.test:runner:1.5.2'
|
|
66
|
+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
67
|
+
|
|
68
|
+
// implementation 'pub.devrel:easypermissions:3.0.0'
|
|
69
|
+
// implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
|
70
|
+
|
|
71
|
+
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
|
|
72
|
+
implementation 'com.squareup.okhttp3:okhttp:3.6.0'
|
|
73
|
+
implementation 'com.squareup.retrofit2:converter-moshi:2.7.2'
|
|
74
|
+
implementation "com.squareup.okhttp3:logging-interceptor:4.11.0"
|
|
75
|
+
implementation 'de.hdodenhof:circleimageview:3.1.0'
|
|
76
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<application>
|
|
3
|
+
<activity android:name="com.managemyhealth.plugin.vonage.VideoCallActivity"
|
|
4
|
+
android:launchMode="singleTask"
|
|
5
|
+
android:screenOrientation="portrait">
|
|
6
|
+
</activity>
|
|
7
|
+
</application>
|
|
8
|
+
</manifest>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.managemyhealth.plugin.vonage;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.view.Gravity;
|
|
5
|
+
import android.view.LayoutInflater;
|
|
6
|
+
import android.view.View;
|
|
7
|
+
import android.widget.TextView;
|
|
8
|
+
import android.widget.Toast;
|
|
9
|
+
|
|
10
|
+
public class CustomToastUtils {
|
|
11
|
+
|
|
12
|
+
public static void showGreenToast(Context context, String message) {
|
|
13
|
+
LayoutInflater inflater = LayoutInflater.from(context);
|
|
14
|
+
View layout = inflater.inflate(R.layout.custom_toast_green_layout, null);
|
|
15
|
+
|
|
16
|
+
TextView text = layout.findViewById(R.id.toastView);
|
|
17
|
+
text.setText(message);
|
|
18
|
+
|
|
19
|
+
Toast toast = new Toast(context);
|
|
20
|
+
toast.setDuration(Toast.LENGTH_SHORT);
|
|
21
|
+
toast.setView(layout);
|
|
22
|
+
|
|
23
|
+
// Set toast position to top right corner
|
|
24
|
+
toast.setGravity(Gravity.TOP | Gravity.END, 0, 0);
|
|
25
|
+
|
|
26
|
+
toast.show();
|
|
27
|
+
}
|
|
28
|
+
}
|