@capgo/capacitor-stream-call 0.0.5 → 0.0.18

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.
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'StreamVideo'
17
- s.dependency 'StreamVideoSwiftUI'
16
+ s.dependency 'StreamVideo', '1.20.0'
17
+ s.dependency 'StreamVideoSwiftUI', '1.20.0'
18
18
  s.swift_version = '5.1'
19
19
  end
package/Package.swift CHANGED
@@ -11,7 +11,7 @@ let package = Package(
11
11
  ],
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14
- .package(url: "https://github.com/GetStream/stream-video-swift.git", exact: "1.16.0")
14
+ .package(url: "https://github.com/GetStream/stream-video-swift.git", exact: "1.20.0")
15
15
  ],
16
16
  targets: [
17
17
  .target(
package/README.md CHANGED
@@ -132,7 +132,10 @@ The SDK will automatically use the system language and these translations.
132
132
  * [`acceptCall()`](#acceptcall)
133
133
  * [`rejectCall()`](#rejectcall)
134
134
  * [`isCameraEnabled()`](#iscameraenabled)
135
+ * [`getCallStatus()`](#getcallstatus)
135
136
  * [Interfaces](#interfaces)
137
+ * [Type Aliases](#type-aliases)
138
+ * [Enums](#enums)
136
139
 
137
140
  </docgen-index>
138
141
 
@@ -294,11 +297,26 @@ Reject an incoming call
294
297
  isCameraEnabled() => Promise<CameraEnabledResponse>
295
298
  ```
296
299
 
300
+ Check if camera is enabled
301
+
297
302
  **Returns:** <code>Promise&lt;<a href="#cameraenabledresponse">CameraEnabledResponse</a>&gt;</code>
298
303
 
299
304
  --------------------
300
305
 
301
306
 
307
+ ### getCallStatus()
308
+
309
+ ```typescript
310
+ getCallStatus() => Promise<CallEvent>
311
+ ```
312
+
313
+ Get the current call status
314
+
315
+ **Returns:** <code>Promise&lt;<a href="#callevent">CallEvent</a>&gt;</code>
316
+
317
+ --------------------
318
+
319
+
302
320
  ### Interfaces
303
321
 
304
322
 
@@ -323,21 +341,213 @@ isCameraEnabled() => Promise<CameraEnabledResponse>
323
341
 
324
342
  #### CallOptions
325
343
 
326
- | Prop | Type | Description |
327
- | ------------- | --------------------- | ------------------------------------------------ |
328
- | **`userIds`** | <code>string[]</code> | User ID of the person to call |
329
- | **`type`** | <code>string</code> | Type of call, defaults to 'default' |
330
- | **`ring`** | <code>boolean</code> | Whether to ring the other user, defaults to true |
344
+ | Prop | Type | Description |
345
+ | ------------- | --------------------------------------------- | ------------------------------------------------ |
346
+ | **`userIds`** | <code>string[]</code> | User ID of the person to call |
347
+ | **`type`** | <code><a href="#calltype">CallType</a></code> | Type of call, defaults to 'default' |
348
+ | **`ring`** | <code>boolean</code> | Whether to ring the other user, defaults to true |
349
+ | **`team`** | <code>string</code> | Team name to call |
331
350
 
332
351
 
333
352
  #### CallEvent
334
353
 
335
- | Prop | Type | Description |
336
- | ------------ | ------------------- | -------------------------------------------------------------- |
337
- | **`callId`** | <code>string</code> | ID of the call |
338
- | **`state`** | <code>string</code> | Current state of the call |
339
- | **`userId`** | <code>string</code> | User ID of the participant in the call who triggered the event |
340
- | **`reason`** | <code>string</code> | Reason for the call state change |
354
+ | Prop | Type | Description |
355
+ | ------------ | ----------------------------------------------- | -------------------------------------------------------------- |
356
+ | **`callId`** | <code>string</code> | ID of the call |
357
+ | **`state`** | <code><a href="#callstate">CallState</a></code> | Current state of the call |
358
+ | **`userId`** | <code>string</code> | User ID of the participant in the call who triggered the event |
359
+ | **`reason`** | <code>string</code> | Reason for the call state change, if applicable |
360
+
361
+
362
+ #### CallState
363
+
364
+ <a href="#callstate">CallState</a> is the current state of the call
365
+ as seen by an SFU.
366
+
367
+ | Prop | Type | Description |
368
+ | ---------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
369
+ | **`participants`** | <code>Participant[]</code> | participants is the list of participants in the call. In large calls, the list could be truncated in which case, the list of participants contains fewer participants than the counts returned in participant_count. Anonymous participants are **NOT** included in the list. |
370
+ | **`startedAt`** | <code><a href="#timestamp">Timestamp</a></code> | started_at is the time the call session actually started. |
371
+ | **`participantCount`** | <code><a href="#participantcount">ParticipantCount</a></code> | participant_count contains the summary of the counts. |
372
+ | **`pins`** | <code>Pin[]</code> | the list of pins in the call. Pins are ordered in descending order (most important first). |
373
+
374
+
375
+ #### Participant
376
+
377
+ those who are online in the call
378
+
379
+ | Prop | Type | Description |
380
+ | ----------------------- | --------------------------------------------------------------- | ----------------------------- |
381
+ | **`userId`** | <code>string</code> | |
382
+ | **`sessionId`** | <code>string</code> | |
383
+ | **`publishedTracks`** | <code>TrackType[]</code> | map of track id to track type |
384
+ | **`joinedAt`** | <code><a href="#timestamp">Timestamp</a></code> | |
385
+ | **`trackLookupPrefix`** | <code>string</code> | |
386
+ | **`connectionQuality`** | <code><a href="#connectionquality">ConnectionQuality</a></code> | |
387
+ | **`isSpeaking`** | <code>boolean</code> | |
388
+ | **`isDominantSpeaker`** | <code>boolean</code> | |
389
+ | **`audioLevel`** | <code>number</code> | |
390
+ | **`name`** | <code>string</code> | |
391
+ | **`image`** | <code>string</code> | |
392
+ | **`custom`** | <code><a href="#struct">Struct</a></code> | |
393
+ | **`roles`** | <code>string[]</code> | |
394
+
395
+
396
+ #### Timestamp
397
+
398
+ A <a href="#timestamp">Timestamp</a> represents a point in time independent of any time zone or local
399
+ calendar, encoded as a count of seconds and fractions of seconds at
400
+ nanosecond resolution. The count is relative to an epoch at UTC midnight on
401
+ January 1, 1970, in the proleptic Gregorian calendar which extends the
402
+ Gregorian calendar backwards to year one.
403
+
404
+ All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
405
+ second table is needed for interpretation, using a [24-hour linear
406
+ smear](https://developers.google.com/time/smear).
407
+
408
+ The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
409
+ restricting to that range, we ensure that we can convert to and from [RFC
410
+ 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
411
+
412
+ # Examples
413
+
414
+ Example 1: Compute <a href="#timestamp">Timestamp</a> from POSIX `time()`.
415
+
416
+ <a href="#timestamp">Timestamp</a> timestamp;
417
+ timestamp.set_seconds(time(NULL));
418
+ timestamp.set_nanos(0);
419
+
420
+ Example 2: Compute <a href="#timestamp">Timestamp</a> from POSIX `gettimeofday()`.
421
+
422
+ struct timeval tv;
423
+ gettimeofday(&tv, NULL);
424
+
425
+ <a href="#timestamp">Timestamp</a> timestamp;
426
+ timestamp.set_seconds(tv.tv_sec);
427
+ timestamp.set_nanos(tv.tv_usec * 1000);
428
+
429
+ Example 3: Compute <a href="#timestamp">Timestamp</a> from Win32 `GetSystemTimeAsFileTime()`.
430
+
431
+ FILETIME ft;
432
+ GetSystemTimeAsFileTime(&ft);
433
+ UINT64 ticks = (((UINT64)ft.dwHighDateTime) &lt;&lt; 32) | ft.dwLowDateTime;
434
+
435
+ // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
436
+ // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
437
+ <a href="#timestamp">Timestamp</a> timestamp;
438
+ timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
439
+ timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
440
+
441
+ Example 4: Compute <a href="#timestamp">Timestamp</a> from Java `System.currentTimeMillis()`.
442
+
443
+ long millis = System.currentTimeMillis();
444
+
445
+ <a href="#timestamp">Timestamp</a> timestamp = <a href="#timestamp">Timestamp</a>.newBuilder().setSeconds(millis / 1000)
446
+ .setNanos((int) ((millis % 1000) * 1000000)).build();
447
+
448
+
449
+ Example 5: Compute <a href="#timestamp">Timestamp</a> from Java `Instant.now()`.
450
+
451
+ Instant now = Instant.now();
452
+
453
+ <a href="#timestamp">Timestamp</a> timestamp =
454
+ <a href="#timestamp">Timestamp</a>.newBuilder().setSeconds(now.getEpochSecond())
455
+ .setNanos(now.getNano()).build();
456
+
457
+
458
+ Example 6: Compute <a href="#timestamp">Timestamp</a> from current time in Python.
459
+
460
+ timestamp = <a href="#timestamp">Timestamp</a>()
461
+ timestamp.GetCurrentTime()
462
+
463
+ # JSON Mapping
464
+
465
+ In JSON format, the <a href="#timestamp">Timestamp</a> type is encoded as a string in the
466
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
467
+ format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
468
+ where {year} is always expressed using four digits while {month}, {day},
469
+ {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
470
+ seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
471
+ are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
472
+ is required. A proto3 JSON serializer should always use UTC (as indicated by
473
+ "Z") when printing the <a href="#timestamp">Timestamp</a> type and a proto3 JSON parser should be
474
+ able to accept both UTC and other timezones (as indicated by an offset).
475
+
476
+ For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
477
+ 01:30 UTC on January 15, 2017.
478
+
479
+ In JavaScript, one can convert a Date object to this format using the
480
+ standard
481
+ [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
482
+ method. In Python, a standard `datetime.datetime` object can be converted
483
+ to this format using
484
+ [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
485
+ the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
486
+ the Joda Time's [`ISODateTimeFormat.dateTime()`](
487
+ http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
488
+ ) to obtain a formatter capable of generating timestamps in this format.
489
+
490
+ | Prop | Type | Description |
491
+ | ------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
492
+ | **`seconds`** | <code>string</code> | Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. |
493
+ | **`nanos`** | <code>number</code> | Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. |
494
+
495
+
496
+ #### Struct
497
+
498
+ <a href="#struct">`Struct`</a> represents a structured data value, consisting of fields
499
+ which map to dynamically typed values. In some languages, `Struct`
500
+ might be supported by a native representation. For example, in
501
+ scripting languages like JS a struct is represented as an
502
+ object. The details of that representation are described together
503
+ with the proto support for the language.
504
+
505
+ The JSON representation for <a href="#struct">`Struct`</a> is JSON object.
506
+
507
+ | Prop | Type | Description |
508
+ | ------------ | ----------------------------------------------------------- | ------------------------------------------ |
509
+ | **`fields`** | <code>{ [key: string]: <a href="#value">Value</a>; }</code> | Unordered map of dynamically typed values. |
510
+
511
+
512
+ #### Value
513
+
514
+ <a href="#value">`Value`</a> represents a dynamically typed value which can be either
515
+ null, a number, a string, a boolean, a recursive struct value, or a
516
+ list of values. A producer of value is expected to set one of these
517
+ variants. Absence of any variant indicates an error.
518
+
519
+ The JSON representation for <a href="#value">`Value`</a> is JSON value.
520
+
521
+ | Prop | Type |
522
+ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
523
+ | **`kind`** | <code>{ oneofKind: 'nullValue'; nullValue: <a href="#nullvalue">NullValue</a>; } \| { oneofKind: 'numberValue'; numberValue: number; } \| { oneofKind: 'stringValue'; stringValue: string; } \| { oneofKind: 'boolValue'; boolValue: boolean; } \| { oneofKind: 'structValue'; structValue: <a href="#struct">Struct</a>; } \| { oneofKind: 'listValue'; listValue: <a href="#listvalue">ListValue</a>; } \| { oneofKind: undefined; }</code> |
524
+
525
+
526
+ #### ListValue
527
+
528
+ <a href="#listvalue">`ListValue`</a> is a wrapper around a repeated field of values.
529
+
530
+ The JSON representation for <a href="#listvalue">`ListValue`</a> is JSON array.
531
+
532
+ | Prop | Type | Description |
533
+ | ------------ | -------------------- | ------------------------------------------- |
534
+ | **`values`** | <code>Value[]</code> | Repeated field of dynamically typed values. |
535
+
536
+
537
+ #### ParticipantCount
538
+
539
+ | Prop | Type | Description |
540
+ | --------------- | ------------------- | ------------------------------------------------------------------------------ |
541
+ | **`total`** | <code>number</code> | Total number of participants in the call including the anonymous participants. |
542
+ | **`anonymous`** | <code>number</code> | Total number of anonymous participants in the call. |
543
+
544
+
545
+ #### Pin
546
+
547
+ | Prop | Type | Description |
548
+ | --------------- | ------------------- | ------------------------------------------------------------------- |
549
+ | **`userId`** | <code>string</code> | the user to pin |
550
+ | **`sessionId`** | <code>string</code> | the user sesion_id to pin, if not provided, applies to all sessions |
341
551
 
342
552
 
343
553
  #### CameraEnabledResponse
@@ -346,4 +556,48 @@ isCameraEnabled() => Promise<CameraEnabledResponse>
346
556
  | ------------- | -------------------- |
347
557
  | **`enabled`** | <code>boolean</code> |
348
558
 
559
+
560
+ ### Type Aliases
561
+
562
+
563
+ #### CallType
564
+
565
+ <code>'default' | 'audio_room' | 'livestream' | 'development'</code>
566
+
567
+
568
+ #### CallState
569
+
570
+ <code>'idle' | 'ringing' | 'joining' | 'reconnecting' | 'joined' | 'leaving' | 'left' | 'created' | 'session_started' | 'rejected' | 'missed' | 'accepted' | 'ended' | 'unknown'</code>
571
+
572
+
573
+ ### Enums
574
+
575
+
576
+ #### TrackType
577
+
578
+ | Members | Value |
579
+ | ------------------------ | -------------- |
580
+ | **`UNSPECIFIED`** | <code>0</code> |
581
+ | **`AUDIO`** | <code>1</code> |
582
+ | **`VIDEO`** | <code>2</code> |
583
+ | **`SCREEN_SHARE`** | <code>3</code> |
584
+ | **`SCREEN_SHARE_AUDIO`** | <code>4</code> |
585
+
586
+
587
+ #### ConnectionQuality
588
+
589
+ | Members | Value |
590
+ | ----------------- | -------------- |
591
+ | **`UNSPECIFIED`** | <code>0</code> |
592
+ | **`POOR`** | <code>1</code> |
593
+ | **`GOOD`** | <code>2</code> |
594
+ | **`EXCELLENT`** | <code>3</code> |
595
+
596
+
597
+ #### NullValue
598
+
599
+ | Members | Value | Description |
600
+ | ---------------- | -------------- | ----------- |
601
+ | **`NULL_VALUE`** | <code>0</code> | Null value. |
602
+
349
603
  </docgen-api>
@@ -64,10 +64,28 @@ dependencies {
64
64
  implementation project(':capacitor-android')
65
65
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
66
66
  implementation 'androidx.core:core-ktx:1.15.0'
67
- implementation 'androidx.compose.material3:material3'
68
- implementation("io.getstream:stream-video-android-ui-compose:1.3.1")
69
- implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
70
- implementation("io.getstream:stream-android-push-firebase:1.3.0")
67
+
68
+ // Compose dependencies with consistent versions
69
+ def compose_version = '1.6.8'
70
+ implementation "androidx.activity:activity-compose:1.10.1"
71
+ implementation "androidx.compose.ui:ui:$compose_version"
72
+ implementation "androidx.compose.ui:ui-tooling:$compose_version"
73
+ implementation "androidx.compose.foundation:foundation:$compose_version"
74
+ implementation "androidx.compose.runtime:runtime:$compose_version"
75
+ implementation "androidx.compose.material3:material3:1.3.1"
76
+
77
+ // Stream dependencies
78
+ implementation("io.getstream:stream-video-android-ui-compose:1.4.5")
79
+ implementation("io.getstream:stream-video-android-core:1.4.5")
80
+ implementation("io.getstream:stream-android-push:1.3.1")
81
+ implementation("io.getstream:stream-android-push-firebase:1.3.1")
82
+
83
+ // Firebase dependencies using BOM
84
+ implementation(platform('com.google.firebase:firebase-bom:32.8.0'))
85
+ implementation('com.google.firebase:firebase-messaging-ktx')
86
+
87
+ implementation("androidx.coordinatorlayout:coordinatorlayout:1.3.0")
88
+ implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.8.1'
71
89
  testImplementation "junit:junit:$junitVersion"
72
90
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
73
91
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -24,7 +24,7 @@ class CustomNotificationHandler(
24
24
  private const val PREFS_NAME = "StreamCallPrefs"
25
25
  private const val KEY_NOTIFICATION_TIME = "notification_creation_time"
26
26
  }
27
- var allowSound = true;
27
+ private var allowSound = true;
28
28
 
29
29
  override fun getIncomingCallNotification(
30
30
  fullScreenPendingIntent: PendingIntent,
@@ -76,7 +76,7 @@ class CustomNotificationHandler(
76
76
  setDefaults(NotificationCompat.DEFAULT_VIBRATE or NotificationCompat.DEFAULT_LIGHTS)
77
77
  }
78
78
 
79
- setVibrate(longArrayOf(0, 1000, 500, 1000))
79
+ // setVibrate(longArrayOf(0, 1000, 500, 1000))
80
80
  setLights(0xFF0000FF.toInt(), 1000, 1000)
81
81
  setFullScreenIntent(fullScreenPendingIntent, true)
82
82
  if (shouldHaveContentIntent) {