@capgo/capacitor-stream-call 7.1.31 → 7.4.0
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/README.md +82 -10
- package/android/src/main/AndroidManifest.xml +0 -6
- package/android/src/main/java/ee/forgr/capacitor/streamcall/AcceptCallReceiver.kt +1 -1
- package/android/src/main/java/ee/forgr/capacitor/streamcall/CustomStreamIntentResolver.kt +2 -2
- package/android/src/main/java/ee/forgr/capacitor/streamcall/StreamCallPlugin.kt +2937 -2464
- package/android/src/main/res/raw/outgoing.mp3 +0 -0
- package/dist/docs.json +185 -1
- package/dist/esm/definitions.d.ts +55 -2
- 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/StreamCallPlugin/StreamCallPlugin.swift +420 -136
- package/ios/Sources/StreamCallPlugin/TouchInterceptView.swift +35 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -240,15 +240,19 @@ export class CallService {
|
|
|
240
240
|
* [`logout()`](#logout)
|
|
241
241
|
* [`call(...)`](#call)
|
|
242
242
|
* [`endCall()`](#endcall)
|
|
243
|
+
* [`joinCall(...)`](#joincall)
|
|
243
244
|
* [`setMicrophoneEnabled(...)`](#setmicrophoneenabled)
|
|
244
245
|
* [`setCameraEnabled(...)`](#setcameraenabled)
|
|
245
246
|
* [`addListener('callEvent', ...)`](#addlistenercallevent-)
|
|
246
247
|
* [`addListener('incomingCall', ...)`](#addlistenerincomingcall-)
|
|
247
248
|
* [`removeAllListeners()`](#removealllisteners)
|
|
249
|
+
* [`enableBluetooth()`](#enablebluetooth)
|
|
248
250
|
* [`acceptCall()`](#acceptcall)
|
|
249
251
|
* [`rejectCall()`](#rejectcall)
|
|
250
252
|
* [`isCameraEnabled()`](#iscameraenabled)
|
|
251
253
|
* [`getCallStatus()`](#getcallstatus)
|
|
254
|
+
* [`getRingingCall()`](#getringingcall)
|
|
255
|
+
* [`toggleViews()`](#toggleviews)
|
|
252
256
|
* [`setSpeaker(...)`](#setspeaker)
|
|
253
257
|
* [`switchCamera(...)`](#switchcamera)
|
|
254
258
|
* [`getCallInfo(...)`](#getcallinfo)
|
|
@@ -324,6 +328,23 @@ End the current call
|
|
|
324
328
|
--------------------
|
|
325
329
|
|
|
326
330
|
|
|
331
|
+
### joinCall(...)
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
joinCall(options: { callId: string; callType: string; }) => Promise<SuccessResponse>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Join an existing call
|
|
338
|
+
|
|
339
|
+
| Param | Type | Description |
|
|
340
|
+
| ------------- | -------------------------------------------------- | ------------------ |
|
|
341
|
+
| **`options`** | <code>{ callId: string; callType: string; }</code> | - Microphone state |
|
|
342
|
+
|
|
343
|
+
**Returns:** <code>Promise<<a href="#successresponse">SuccessResponse</a>></code>
|
|
344
|
+
|
|
345
|
+
--------------------
|
|
346
|
+
|
|
347
|
+
|
|
327
348
|
### setMicrophoneEnabled(...)
|
|
328
349
|
|
|
329
350
|
```typescript
|
|
@@ -406,6 +427,19 @@ Remove all event listeners
|
|
|
406
427
|
--------------------
|
|
407
428
|
|
|
408
429
|
|
|
430
|
+
### enableBluetooth()
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
enableBluetooth() => Promise<SuccessResponse>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Enable bluetooth audio
|
|
437
|
+
|
|
438
|
+
**Returns:** <code>Promise<<a href="#successresponse">SuccessResponse</a>></code>
|
|
439
|
+
|
|
440
|
+
--------------------
|
|
441
|
+
|
|
442
|
+
|
|
409
443
|
### acceptCall()
|
|
410
444
|
|
|
411
445
|
```typescript
|
|
@@ -458,6 +492,32 @@ Get the current call status
|
|
|
458
492
|
--------------------
|
|
459
493
|
|
|
460
494
|
|
|
495
|
+
### getRingingCall()
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
getRingingCall() => Promise<CallEvent>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Get the current ringing call
|
|
502
|
+
|
|
503
|
+
**Returns:** <code>Promise<<a href="#callevent">CallEvent</a>></code>
|
|
504
|
+
|
|
505
|
+
--------------------
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
### toggleViews()
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
toggleViews() => Promise<{ newLayout: StreamCallLayout; }>
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
Cycle through the available video layouts
|
|
515
|
+
|
|
516
|
+
**Returns:** <code>Promise<{ newLayout: <a href="#streamcalllayout">StreamCallLayout</a>; }></code>
|
|
517
|
+
|
|
518
|
+
--------------------
|
|
519
|
+
|
|
520
|
+
|
|
461
521
|
### setSpeaker(...)
|
|
462
522
|
|
|
463
523
|
```typescript
|
|
@@ -560,6 +620,7 @@ Get the current user's information
|
|
|
560
620
|
| Prop | Type | Description |
|
|
561
621
|
| ------------- | -------------------- | ------------------------------------ |
|
|
562
622
|
| **`success`** | <code>boolean</code> | Whether the operation was successful |
|
|
623
|
+
| **`callId`** | <code>string</code> | |
|
|
563
624
|
|
|
564
625
|
|
|
565
626
|
#### LoginOptions
|
|
@@ -597,14 +658,16 @@ Get the current user's information
|
|
|
597
658
|
|
|
598
659
|
#### CallEvent
|
|
599
660
|
|
|
600
|
-
| Prop | Type
|
|
601
|
-
| ------------- |
|
|
602
|
-
| **`callId`** | <code>string</code>
|
|
603
|
-
| **`state`** | <code><a href="#callstate">CallState</a></code>
|
|
604
|
-
| **`userId`** | <code>string</code>
|
|
605
|
-
| **`reason`** | <code>string</code>
|
|
606
|
-
| **`caller`** | <code><a href="#callmember">CallMember</a></code>
|
|
607
|
-
| **`members`** | <code>CallMember[]</code>
|
|
661
|
+
| Prop | Type | Description |
|
|
662
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
663
|
+
| **`callId`** | <code>string</code> | ID of the call |
|
|
664
|
+
| **`state`** | <code><a href="#callstate">CallState</a></code> | Current state of the call |
|
|
665
|
+
| **`userId`** | <code>string</code> | User ID of the participant in the call who triggered the event |
|
|
666
|
+
| **`reason`** | <code>string</code> | Reason for the call state change, if applicable |
|
|
667
|
+
| **`caller`** | <code><a href="#callmember">CallMember</a></code> | Information about the caller (for incoming calls) |
|
|
668
|
+
| **`members`** | <code>CallMember[]</code> | List of call members |
|
|
669
|
+
| **`custom`** | <code><a href="#record">Record</a>< string, \| string \| boolean \| number \| null \| <a href="#record">Record</a><string, string \| boolean \| number \| null> \| string[] \| boolean[] \| number[] ></code> | |
|
|
670
|
+
| **`count`** | <code>number</code> | |
|
|
608
671
|
|
|
609
672
|
|
|
610
673
|
#### CallState
|
|
@@ -817,6 +880,10 @@ The JSON representation for <a href="#listvalue">`ListValue`</a> is JSON array.
|
|
|
817
880
|
| **`caller`** | <code><a href="#callmember">CallMember</a></code> | Information about the caller |
|
|
818
881
|
| **`custom`** | <code><a href="#record">Record</a>< string, \| string \| boolean \| number \| null \| <a href="#record">Record</a><string, string \| boolean \| number \| null> \| string[] \| boolean[] \| number[] ></code> | Custom data to be passed to the call |
|
|
819
882
|
|
|
883
|
+
| Method | Signature | Description |
|
|
884
|
+
| -------------------- | -------------------------------------------- | --------------------------------------- |
|
|
885
|
+
| **getPluginVersion** | () => Promise<{ version: string; }> | Get the native Capacitor plugin version |
|
|
886
|
+
|
|
820
887
|
|
|
821
888
|
#### CameraEnabledResponse
|
|
822
889
|
|
|
@@ -848,7 +915,7 @@ The JSON representation for <a href="#listvalue">`ListValue`</a> is JSON array.
|
|
|
848
915
|
|
|
849
916
|
#### CallType
|
|
850
917
|
|
|
851
|
-
<code>'default' | 'audio_room' | 'livestream' | 'development'</code>
|
|
918
|
+
<code>'default' | 'audio' | 'audio_room' | 'livestream' | 'development'</code>
|
|
852
919
|
|
|
853
920
|
|
|
854
921
|
#### Record
|
|
@@ -860,7 +927,12 @@ Construct a type with a set of properties K of type T
|
|
|
860
927
|
|
|
861
928
|
#### CallState
|
|
862
929
|
|
|
863
|
-
<code>'idle' | 'ringing' | 'joining' | 'reconnecting' | 'joined' | 'leaving' | 'left' | 'created' | 'session_started' | 'rejected' | 'missed' | 'accepted' | 'ended' | 'camera_enabled' | 'camera_disabled' | 'microphone_enabled' | 'microphone_disabled' | 'unknown'</code>
|
|
930
|
+
<code>'idle' | 'ringing' | 'joining' | 'reconnecting' | 'joined' | 'leaving' | 'left' | 'created' | 'session_started' | 'rejected' | 'participant_counts' | 'missed' | 'accepted' | 'ended' | 'camera_enabled' | 'camera_disabled' | 'speaker_enabled' | 'speaker_disabled' | 'microphone_enabled' | 'microphone_disabled' | 'outgoing_call_ended' | 'unknown'</code>
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
#### StreamCallLayout
|
|
934
|
+
|
|
935
|
+
<code>'grid' | 'spotlight' | 'dynamic' | 'fullScreen' | 'fullscreen'</code>
|
|
864
936
|
|
|
865
937
|
|
|
866
938
|
### Enums
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
|
3
2
|
<application>
|
|
4
3
|
|
|
5
4
|
<service
|
|
@@ -14,11 +13,6 @@
|
|
|
14
13
|
</intent-filter>
|
|
15
14
|
</service>
|
|
16
15
|
|
|
17
|
-
<service
|
|
18
|
-
android:name="ee.forgr.capacitor.streamcall.StreamCallBackgroundService"
|
|
19
|
-
android:enabled="true"
|
|
20
|
-
android:exported="false" />
|
|
21
|
-
|
|
22
16
|
<receiver
|
|
23
17
|
android:name=".AcceptCallReceiver"
|
|
24
18
|
android:enabled="true"
|
|
@@ -24,7 +24,7 @@ class AcceptCallReceiver : BroadcastReceiver() {
|
|
|
24
24
|
if (launchIntent != null) {
|
|
25
25
|
launchIntent.action = NotificationHandler.ACTION_ACCEPT_CALL
|
|
26
26
|
launchIntent.putExtra(NotificationHandler.INTENT_EXTRA_CALL_CID, cid)
|
|
27
|
-
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
|
27
|
+
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
28
28
|
context.startActivity(launchIntent)
|
|
29
29
|
Log.d("AcceptCallReceiver", "Started MainActivity to handle ACCEPT_CALL action.")
|
|
30
30
|
} else {
|
|
@@ -18,7 +18,7 @@ class CustomStreamIntentResolver(private val context: Application) : StreamInten
|
|
|
18
18
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
|
19
19
|
putExtra(NotificationHandler.INTENT_EXTRA_CALL_CID, callId)
|
|
20
20
|
action = "io.getstream.video.android.action.INCOMING_CALL"
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
} ?: Intent(Intent.ACTION_MAIN).apply {
|
|
23
23
|
setPackage(context.packageName)
|
|
24
24
|
addCategory(Intent.CATEGORY_LAUNCHER)
|
|
@@ -162,4 +162,4 @@ class CustomStreamIntentResolver(private val context: Application) : StreamInten
|
|
|
162
162
|
putExtra(NotificationHandler.INTENT_EXTRA_NOTIFICATION_ID, NotificationHandler.INCOMING_CALL_NOTIFICATION_ID)
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
}
|
|
165
|
+
}
|