@capgo/capacitor-twilio-voice 7.3.0-alpha.1 → 7.4.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/android/src/main/java/ee/forgr/capacitor_twilio_voice/CapacitorTwilioVoicePlugin.java +67 -54
- package/dist/docs.json +19 -0
- package/dist/esm/definitions.d.ts +9 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorTwilioVoicePlugin/CapacitorTwilioVoicePlugin.swift +26 -19
- package/package.json +1 -1
package/android/src/main/java/ee/forgr/capacitor_twilio_voice/CapacitorTwilioVoicePlugin.java
CHANGED
|
@@ -75,6 +75,8 @@ import org.json.JSONObject;
|
|
|
75
75
|
)
|
|
76
76
|
public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
77
77
|
|
|
78
|
+
private final String PLUGIN_VERSION = "7.4.1";
|
|
79
|
+
|
|
78
80
|
private static final String TAG = "CapacitorTwilioVoice";
|
|
79
81
|
private static final String PREF_ACCESS_TOKEN = "twilio_access_token";
|
|
80
82
|
private static final String PREF_FCM_TOKEN = "twilio_fcm_token";
|
|
@@ -301,12 +303,12 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
301
303
|
|
|
302
304
|
// Delay the auto-accept slightly to ensure plugin is fully loaded
|
|
303
305
|
new android.os.Handler().postDelayed(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
() -> {
|
|
307
|
+
Log.d(TAG, "Auto-accepting call: " + callSid);
|
|
308
|
+
ensureMicPermissionThenAccept(callSid);
|
|
309
|
+
},
|
|
310
|
+
500
|
|
311
|
+
);
|
|
310
312
|
}
|
|
311
313
|
}
|
|
312
314
|
}
|
|
@@ -340,20 +342,20 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
340
342
|
if (callInvite != null) {
|
|
341
343
|
// Delay sending the event to ensure JavaScript is ready
|
|
342
344
|
new android.os.Handler().postDelayed(
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
345
|
+
() -> {
|
|
346
|
+
Log.d(TAG, "Sending incoming call event to JavaScript: " + callSid);
|
|
347
|
+
|
|
348
|
+
JSObject data = new JSObject();
|
|
349
|
+
data.put("callSid", callSid);
|
|
350
|
+
data.put("from", callFrom);
|
|
351
|
+
data.put("to", callInvite.getTo());
|
|
352
|
+
data.put("callerName", callerName != null ? callerName : callFrom);
|
|
353
|
+
data.put("openedFromNotification", true);
|
|
354
|
+
|
|
355
|
+
notifyListeners("callInviteReceived", data);
|
|
356
|
+
},
|
|
357
|
+
1000
|
|
358
|
+
); // Give JavaScript more time to initialize
|
|
357
359
|
} else {
|
|
358
360
|
Log.w(TAG, "Call invite not found for SID: " + callSid + " (may have been cancelled)");
|
|
359
361
|
}
|
|
@@ -391,13 +393,13 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
391
393
|
Log.d(
|
|
392
394
|
TAG,
|
|
393
395
|
"handleOnResume: hasPermission=" +
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
hasMicrophonePermission() +
|
|
397
|
+
", awaitingSettings=" +
|
|
398
|
+
awaitingSettingsResult +
|
|
399
|
+
", pendingCall=" +
|
|
400
|
+
(pendingPermissionCall != null) +
|
|
401
|
+
", pendingAction=" +
|
|
402
|
+
pendingPermissionAction
|
|
401
403
|
);
|
|
402
404
|
if (hasMicrophonePermission()) {
|
|
403
405
|
if (pendingPermissionAction != PendingPermissionAction.NONE || pendingPermissionCall != null) {
|
|
@@ -850,9 +852,9 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
850
852
|
Log.d(
|
|
851
853
|
TAG,
|
|
852
854
|
"handleMicrophonePermissionGranted: pendingAction=" +
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
855
|
+
pendingPermissionAction +
|
|
856
|
+
", pendingCall=" +
|
|
857
|
+
(pendingPermissionCall != null)
|
|
856
858
|
);
|
|
857
859
|
permissionAttemptCount = 0;
|
|
858
860
|
|
|
@@ -906,13 +908,13 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
906
908
|
Log.d(
|
|
907
909
|
TAG,
|
|
908
910
|
"handleMicrophonePermissionDenied: canRequestAgain=" +
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
911
|
+
canRequestAgain +
|
|
912
|
+
", attempt=" +
|
|
913
|
+
permissionAttemptCount +
|
|
914
|
+
", pendingAction=" +
|
|
915
|
+
pendingPermissionAction +
|
|
916
|
+
", standaloneCall=" +
|
|
917
|
+
(pendingPermissionCall != null)
|
|
916
918
|
);
|
|
917
919
|
|
|
918
920
|
if (pendingPermissionAction == PendingPermissionAction.NONE && pendingPermissionCall != null) {
|
|
@@ -1019,11 +1021,11 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
1019
1021
|
Log.d(
|
|
1020
1022
|
TAG,
|
|
1021
1023
|
"openAppSettings: awaitingSettingsResult=" +
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1024
|
+
awaitingSettingsResult +
|
|
1025
|
+
", pendingAction=" +
|
|
1026
|
+
pendingPermissionAction +
|
|
1027
|
+
", pendingCall=" +
|
|
1028
|
+
(pendingPermissionCall != null)
|
|
1027
1029
|
);
|
|
1028
1030
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
1029
1031
|
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
|
|
@@ -1305,11 +1307,11 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
1305
1307
|
Log.d(
|
|
1306
1308
|
TAG,
|
|
1307
1309
|
"requestMicrophonePermission: requestedBefore=" +
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1310
|
+
requestedBefore +
|
|
1311
|
+
", shouldShow=" +
|
|
1312
|
+
shouldShow +
|
|
1313
|
+
", pendingAction=" +
|
|
1314
|
+
pendingPermissionAction
|
|
1313
1315
|
);
|
|
1314
1316
|
|
|
1315
1317
|
if (pendingPermissionAction == PendingPermissionAction.NONE && !shouldShow && requestedBefore) {
|
|
@@ -1347,13 +1349,13 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
1347
1349
|
Log.d(
|
|
1348
1350
|
TAG,
|
|
1349
1351
|
"handleRequestPermissionsResult: granted=" +
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1352
|
+
granted +
|
|
1353
|
+
", attempt=" +
|
|
1354
|
+
permissionAttemptCount +
|
|
1355
|
+
", pendingAction=" +
|
|
1356
|
+
pendingPermissionAction +
|
|
1357
|
+
", standaloneCall=" +
|
|
1358
|
+
(pendingPermissionCall != null)
|
|
1357
1359
|
);
|
|
1358
1360
|
if (granted) {
|
|
1359
1361
|
handleMicrophonePermissionGranted();
|
|
@@ -1777,4 +1779,15 @@ public class CapacitorTwilioVoicePlugin extends Plugin {
|
|
|
1777
1779
|
Log.e(TAG, "Call invite not found for SID: " + callSid);
|
|
1778
1780
|
}
|
|
1779
1781
|
}
|
|
1782
|
+
|
|
1783
|
+
@PluginMethod
|
|
1784
|
+
public void getPluginVersion(final PluginCall call) {
|
|
1785
|
+
try {
|
|
1786
|
+
final JSObject ret = new JSObject();
|
|
1787
|
+
ret.put("version", this.PLUGIN_VERSION);
|
|
1788
|
+
call.resolve(ret);
|
|
1789
|
+
} catch (final Exception e) {
|
|
1790
|
+
call.reject("Could not get plugin version", e);
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1780
1793
|
}
|
package/dist/docs.json
CHANGED
|
@@ -453,6 +453,25 @@
|
|
|
453
453
|
"docs": "",
|
|
454
454
|
"complexTypes": [],
|
|
455
455
|
"slug": "removealllisteners"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "getPluginVersion",
|
|
459
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
460
|
+
"parameters": [],
|
|
461
|
+
"returns": "Promise<{ version: string; }>",
|
|
462
|
+
"tags": [
|
|
463
|
+
{
|
|
464
|
+
"name": "returns",
|
|
465
|
+
"text": "a Promise with version for this plugin"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "throws",
|
|
469
|
+
"text": "An error if something went wrong"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"docs": "Get the native Capacitor plugin version",
|
|
473
|
+
"complexTypes": [],
|
|
474
|
+
"slug": "getpluginversion"
|
|
456
475
|
}
|
|
457
476
|
],
|
|
458
477
|
"properties": []
|
|
@@ -106,6 +106,15 @@ export interface CapacitorTwilioVoicePlugin {
|
|
|
106
106
|
error: string;
|
|
107
107
|
}) => void): Promise<PluginListenerHandle>;
|
|
108
108
|
removeAllListeners(): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Get the native Capacitor plugin version
|
|
111
|
+
*
|
|
112
|
+
* @returns {Promise<{ version: string }>} a Promise with version for this plugin
|
|
113
|
+
* @throws An error if something went wrong
|
|
114
|
+
*/
|
|
115
|
+
getPluginVersion(): Promise<{
|
|
116
|
+
version: string;
|
|
117
|
+
}>;
|
|
109
118
|
}
|
|
110
119
|
export interface PluginListenerHandle {
|
|
111
120
|
remove(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorTwilioVoicePlugin {\n // Authentication\n login(options: { accessToken: string }): Promise<{ success: boolean }>;\n logout(): Promise<{ success: boolean }>;\n isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }>;\n\n // Call Management\n makeCall(options: { to: string }): Promise<{ success: boolean; callSid?: string }>;\n acceptCall(options: { callSid: string }): Promise<{ success: boolean }>;\n rejectCall(options: { callSid: string }): Promise<{ success: boolean }>;\n endCall(options: { callSid?: string }): Promise<{ success: boolean }>;\n\n // Call Controls\n muteCall(options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }>;\n setSpeaker(options: { enabled: boolean }): Promise<{ success: boolean }>;\n\n // Call Status\n getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }>;\n\n // Audio Permissions\n checkMicrophonePermission(): Promise<{ granted: boolean }>;\n requestMicrophonePermission(): Promise<{ granted: boolean }>;\n\n // Listeners for events\n addListener(\n eventName: 'callInviteReceived',\n listenerFunc: (data: { callSid: string; from: string; to: string; customParams: Record<string, string> }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callConnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callInviteCancelled',\n listenerFunc: (data: { callSid: string; reason: 'user_declined' | 'remote_cancelled' }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'outgoingCallInitiated',\n listenerFunc: (data: { callSid: string; to: string; source: 'app' | 'system'; displayName?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'outgoingCallFailed',\n listenerFunc: (data: {\n callSid: string;\n to: string;\n reason:\n | 'missing_access_token'\n | 'connection_failed'\n | 'no_call_details'\n | 'microphone_permission_denied'\n | 'invalid_contact'\n | 'callkit_request_failed'\n | 'unsupported_intent';\n displayName?: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callDisconnected',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callRinging',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnecting',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callQualityWarningsChanged',\n listenerFunc: (data: { callSid: string; currentWarnings: string[]; previousWarnings: string[] }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(eventName: 'registrationSuccess', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'registrationFailure',\n listenerFunc: (data: { error: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n removeAllListeners(): Promise<void>;\n}\n\nexport interface PluginListenerHandle {\n remove(): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorTwilioVoicePlugin {\n // Authentication\n login(options: { accessToken: string }): Promise<{ success: boolean }>;\n logout(): Promise<{ success: boolean }>;\n isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }>;\n\n // Call Management\n makeCall(options: { to: string }): Promise<{ success: boolean; callSid?: string }>;\n acceptCall(options: { callSid: string }): Promise<{ success: boolean }>;\n rejectCall(options: { callSid: string }): Promise<{ success: boolean }>;\n endCall(options: { callSid?: string }): Promise<{ success: boolean }>;\n\n // Call Controls\n muteCall(options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }>;\n setSpeaker(options: { enabled: boolean }): Promise<{ success: boolean }>;\n\n // Call Status\n getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }>;\n\n // Audio Permissions\n checkMicrophonePermission(): Promise<{ granted: boolean }>;\n requestMicrophonePermission(): Promise<{ granted: boolean }>;\n\n // Listeners for events\n addListener(\n eventName: 'callInviteReceived',\n listenerFunc: (data: { callSid: string; from: string; to: string; customParams: Record<string, string> }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callConnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callInviteCancelled',\n listenerFunc: (data: { callSid: string; reason: 'user_declined' | 'remote_cancelled' }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'outgoingCallInitiated',\n listenerFunc: (data: { callSid: string; to: string; source: 'app' | 'system'; displayName?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'outgoingCallFailed',\n listenerFunc: (data: {\n callSid: string;\n to: string;\n reason:\n | 'missing_access_token'\n | 'connection_failed'\n | 'no_call_details'\n | 'microphone_permission_denied'\n | 'invalid_contact'\n | 'callkit_request_failed'\n | 'unsupported_intent';\n displayName?: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callDisconnected',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callRinging',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnecting',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callQualityWarningsChanged',\n listenerFunc: (data: { callSid: string; currentWarnings: string[]; previousWarnings: string[] }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(eventName: 'registrationSuccess', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'registrationFailure',\n listenerFunc: (data: { error: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ version: string }>} a Promise with version for this plugin\n * @throws An error if something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n\nexport interface PluginListenerHandle {\n remove(): Promise<void>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
|
@@ -41,5 +41,8 @@ export class CapacitorTwilioVoiceWeb extends WebPlugin {
|
|
|
41
41
|
async requestMicrophonePermission() {
|
|
42
42
|
throw this.unimplemented('Not implemented on web.');
|
|
43
43
|
}
|
|
44
|
+
async getPluginVersion() {
|
|
45
|
+
return { version: 'web' };
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
//# 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,uBAAwB,SAAQ,SAAS;IACpD,iBAAiB;IACjB,KAAK,CAAC,KAAK,CAAC,QAAiC;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,QAAQ,CAAC,QAAwB;QACrC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA8B;QAC1C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,QAAQ,CAAC,QAA8C;QAC3D,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA8B;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACd,KAAK,CAAC,aAAa;QAOjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,yBAAyB;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,2BAA2B;QAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorTwilioVoicePlugin } from './definitions';\n\nexport class CapacitorTwilioVoiceWeb extends WebPlugin implements CapacitorTwilioVoicePlugin {\n // Authentication\n async login(_options: { accessToken: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async logout(): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Management\n async makeCall(_options: { to: string }): Promise<{ success: boolean; callSid?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async acceptCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async rejectCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async endCall(_options: { callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Controls\n async muteCall(_options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async setSpeaker(_options: { enabled: boolean }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Status\n async getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Audio Permissions\n async checkMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\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,uBAAwB,SAAQ,SAAS;IACpD,iBAAiB;IACjB,KAAK,CAAC,KAAK,CAAC,QAAiC;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,QAAQ,CAAC,QAAwB;QACrC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA8B;QAC1C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,QAAQ,CAAC,QAA8C;QAC3D,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA8B;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACd,KAAK,CAAC,aAAa;QAOjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,yBAAyB;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,2BAA2B;QAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorTwilioVoicePlugin } from './definitions';\n\nexport class CapacitorTwilioVoiceWeb extends WebPlugin implements CapacitorTwilioVoicePlugin {\n // Authentication\n async login(_options: { accessToken: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async logout(): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Management\n async makeCall(_options: { to: string }): Promise<{ success: boolean; callSid?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async acceptCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async rejectCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async endCall(_options: { callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Controls\n async muteCall(_options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async setSpeaker(_options: { enabled: boolean }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Status\n async getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Audio Permissions\n async checkMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -48,6 +48,9 @@ class CapacitorTwilioVoiceWeb extends core.WebPlugin {
|
|
|
48
48
|
async requestMicrophonePermission() {
|
|
49
49
|
throw this.unimplemented('Not implemented on web.');
|
|
50
50
|
}
|
|
51
|
+
async getPluginVersion() {
|
|
52
|
+
return { version: 'web' };
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
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 CapacitorTwilioVoice = registerPlugin('CapacitorTwilioVoice', {\n web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),\n});\nexport * from './definitions';\nexport { CapacitorTwilioVoice };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorTwilioVoiceWeb extends WebPlugin {\n // Authentication\n async login(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async logout() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isLoggedIn() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Management\n async makeCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async acceptCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async rejectCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async endCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Controls\n async muteCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setSpeaker(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Status\n async getCallStatus() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Audio Permissions\n async checkMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;AACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC3E,CAAC;;ACFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;AACvD;AACA,IAAI,MAAM,KAAK,CAAC,QAAQ,EAAE;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,OAAO,CAAC,QAAQ,EAAE;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,yBAAyB,GAAG;AACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,2BAA2B,GAAG;AACxC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorTwilioVoice = registerPlugin('CapacitorTwilioVoice', {\n web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),\n});\nexport * from './definitions';\nexport { CapacitorTwilioVoice };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorTwilioVoiceWeb extends WebPlugin {\n // Authentication\n async login(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async logout() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isLoggedIn() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Management\n async makeCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async acceptCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async rejectCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async endCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Controls\n async muteCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setSpeaker(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Status\n async getCallStatus() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Audio Permissions\n async checkMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;AACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC3E,CAAC;;ACFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;AACvD;AACA,IAAI,MAAM,KAAK,CAAC,QAAQ,EAAE;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,OAAO,CAAC,QAAQ,EAAE;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;AACA,IAAI,MAAM,yBAAyB,GAAG;AACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,2BAA2B,GAAG;AACxC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -47,6 +47,9 @@ var capacitorCapacitorTwilioVoice = (function (exports, core) {
|
|
|
47
47
|
async requestMicrophonePermission() {
|
|
48
48
|
throw this.unimplemented('Not implemented on web.');
|
|
49
49
|
}
|
|
50
|
+
async getPluginVersion() {
|
|
51
|
+
return { version: 'web' };
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
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 CapacitorTwilioVoice = registerPlugin('CapacitorTwilioVoice', {\n web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),\n});\nexport * from './definitions';\nexport { CapacitorTwilioVoice };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorTwilioVoiceWeb extends WebPlugin {\n // Authentication\n async login(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async logout() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isLoggedIn() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Management\n async makeCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async acceptCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async rejectCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async endCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Controls\n async muteCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setSpeaker(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Status\n async getCallStatus() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Audio Permissions\n async checkMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;IACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;IAC3E,CAAC;;ICFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;IACvD;IACA,IAAI,MAAM,KAAK,CAAC,QAAQ,EAAE;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAAQ,EAAE;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,yBAAyB,GAAG;IACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,2BAA2B,GAAG;IACxC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorTwilioVoice = registerPlugin('CapacitorTwilioVoice', {\n web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),\n});\nexport * from './definitions';\nexport { CapacitorTwilioVoice };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorTwilioVoiceWeb extends WebPlugin {\n // Authentication\n async login(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async logout() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isLoggedIn() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Management\n async makeCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async acceptCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async rejectCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async endCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Controls\n async muteCall(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setSpeaker(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n // Call Status\n async getCallStatus() {\n throw this.unimplemented('Not implemented on web.');\n }\n // Audio Permissions\n async checkMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestMicrophonePermission() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;IACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;IAC3E,CAAC;;ICFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;IACvD;IACA,IAAI,MAAM,KAAK,CAAC,QAAQ,EAAE;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAAQ,EAAE;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;IACA,IAAI,MAAM,yBAAyB,GAAG;IACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,2BAA2B,GAAG;IACxC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -27,6 +27,7 @@ public protocol PushKitEventDelegate: AnyObject {
|
|
|
27
27
|
*/
|
|
28
28
|
@objc(CapacitorTwilioVoicePlugin)
|
|
29
29
|
public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEventDelegate {
|
|
30
|
+
private let PLUGIN_VERSION: String = "7.4.1"
|
|
30
31
|
|
|
31
32
|
public let identifier = "CapacitorTwilioVoicePlugin"
|
|
32
33
|
public let jsName = "CapacitorTwilioVoice"
|
|
@@ -43,7 +44,8 @@ public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEve
|
|
|
43
44
|
|
|
44
45
|
CAPPluginMethod(name: "getCallStatus", returnType: CAPPluginReturnPromise),
|
|
45
46
|
CAPPluginMethod(name: "checkMicrophonePermission", returnType: CAPPluginReturnPromise),
|
|
46
|
-
CAPPluginMethod(name: "requestMicrophonePermission", returnType: CAPPluginReturnPromise)
|
|
47
|
+
CAPPluginMethod(name: "requestMicrophonePermission", returnType: CAPPluginReturnPromise),
|
|
48
|
+
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
47
49
|
]
|
|
48
50
|
|
|
49
51
|
// MARK: - Properties
|
|
@@ -387,12 +389,12 @@ public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEve
|
|
|
387
389
|
to: to,
|
|
388
390
|
isSystemInitiated: false,
|
|
389
391
|
completion: { success in
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
if success {
|
|
393
|
+
call.resolve(["success": true, "callSid": uuid.uuidString])
|
|
394
|
+
} else {
|
|
395
|
+
call.reject("Failed to start call")
|
|
396
|
+
}
|
|
397
|
+
})
|
|
396
398
|
}
|
|
397
399
|
}
|
|
398
400
|
|
|
@@ -445,11 +447,11 @@ public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEve
|
|
|
445
447
|
|
|
446
448
|
NSLog("Initiating CallKit start call action for intent target: \(handleValue)")
|
|
447
449
|
self.performStartCallAction(uuid: UUID(),
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
handle: handleValue,
|
|
451
|
+
to: handleValue,
|
|
452
|
+
isSystemInitiated: true,
|
|
453
|
+
displayName: displayName,
|
|
454
|
+
completion: { _ in })
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
457
|
|
|
@@ -665,7 +667,7 @@ public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEve
|
|
|
665
667
|
if !contact.displayName.isEmpty {
|
|
666
668
|
return contact.displayName
|
|
667
669
|
}
|
|
668
|
-
|
|
670
|
+
|
|
669
671
|
let displayName = contact.displayName
|
|
670
672
|
|
|
671
673
|
if let nameComponents = contact.nameComponents {
|
|
@@ -834,9 +836,9 @@ public class CapacitorTwilioVoicePlugin: CAPPlugin, CAPBridgedPlugin, PushKitEve
|
|
|
834
836
|
completion(false)
|
|
835
837
|
|
|
836
838
|
self?.emitOutgoingCallFailed(uuid: uuid,
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
839
|
+
to: to,
|
|
840
|
+
displayName: displayName,
|
|
841
|
+
reason: "callkit_request_failed")
|
|
840
842
|
return
|
|
841
843
|
}
|
|
842
844
|
|
|
@@ -1121,9 +1123,9 @@ extension CapacitorTwilioVoicePlugin: CXProviderDelegate {
|
|
|
1121
1123
|
var pendingCall = pendingOutgoingCalls[uuid]
|
|
1122
1124
|
if pendingCall == nil {
|
|
1123
1125
|
let fallback = PendingOutgoingCall(to: handleValue,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1126
|
+
completion: { _ in },
|
|
1127
|
+
isSystemInitiated: true,
|
|
1128
|
+
displayName: nil)
|
|
1127
1129
|
pendingOutgoingCalls[uuid] = fallback
|
|
1128
1130
|
pendingCall = fallback
|
|
1129
1131
|
}
|
|
@@ -1242,4 +1244,9 @@ extension CapacitorTwilioVoicePlugin: AVAudioPlayerDelegate {
|
|
|
1242
1244
|
NSLog("Audio player decode error: \(error.localizedDescription)")
|
|
1243
1245
|
}
|
|
1244
1246
|
}
|
|
1247
|
+
|
|
1248
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
1249
|
+
call.resolve(["version": self.PLUGIN_VERSION])
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1245
1252
|
}
|