Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Aug 27, 2024
2 parents 068ef57 + 9b4ffee commit 94b4a76
Show file tree
Hide file tree
Showing 29 changed files with 736 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ object Configuration {
const val minSdk = 24
const val majorVersion = 1
const val minorVersion = 0
const val patchVersion = 12
const val patchVersion = 13
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 36
const val versionCode = 37
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.1.5"
const val streamVideoCallGooglePlayVersion = "1.1.6"
const val streamWebRtcVersionName = "1.1.1"
}
23 changes: 11 additions & 12 deletions docusaurus/docs/Android/04-ui-components/06-ui-previews.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ Now, you can implement your preview composable like the example below:
@Preview
@Composable
private fun CallContentPreview() {
StreamMockUtils.initializeStreamVideo(LocalContext.current)
StreamPreviewDataUtils.initializeStreamVideo(LocalContext.current)
VideoTheme {
CallContent(
modifier = Modifier.background(color = VideoTheme.colors.appBackground),
call = mockCall,
call = previewCall,
)
}
}
Expand All @@ -49,29 +48,29 @@ After adding the above example to your project, you'll see the following preview

You should follow the steps below to make your previews work well:

1. Initialize a mock `StreamVideo` with the following method: `StreamMockUtils.initializeStreamVideo`.
1. Initialize a mock `StreamVideo` with the following method: `StreamPreviewDataUtils.initializeStreamVideo`.
2. Wrap your composable with the `VideoTheme`.
3. Use the provided mock instances for Stream Video UI components.

This library provides the following mocks:

- **mockCall**: Mock a `Call` that contains few of mock users.
- **mockParticipant**: Mock a `ParticipantState` instance.
- **mockParticipantList**: Mock a list of `ParticipantState` instances.
- **mockUsers**: Mock a list of `User` instances.
- **mockVideoMediaTrack**: Mock a new `MediaTrack` instance.
- **previewCall**: Mock a `Call` that contains few of mock users.
- **previewParticipant**: Mock a `ParticipantState` instance.
- **previewParticipantsList**: Mock a list of `ParticipantState` instances.
- **previewUsers**: Mock a list of `User` instances.
- **previewVideoMediaTrack**: Mock a new `MediaTrack` instance.

For example, you can build a preview Composable for `ParticipantVideo` as in the example below:

```kotlin
@Preview
@Composable
private fun ParticipantVideoPreview() {
StreamMockUtils.initializeStreamVideo(LocalContext.current)
StreamPreviewDataUtils.initializeStreamVideo(LocalContext.current)
VideoTheme {
ParticipantVideoRenderer(
call = mockCall,
participant = mockParticipant,
call = previewCall,
participant = previewParticipant,
)
}
}
Expand Down
10 changes: 5 additions & 5 deletions docusaurus/docs/Android/04-ui-components/07-ui-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ScreenTests {
composable: @Composable () -> Unit
) {
paparazzi.snapshot(name = name) {
StreamMockUtils.initializeStreamVideo(LocalContext.current)
StreamPreviewDataUtils.initializeStreamVideo(LocalContext.current)
CompositionLocalProvider(
LocalInspectionMode provides true,
LocalAvatarPreviewPlaceholder provides
Expand All @@ -49,7 +49,7 @@ class ScreenTests {
@Test
fun `snapshot CallContent component`() {
snapshot(name = "CallContent") {
CallContent(call = mockCall)
CallContent(call = previewCall)
}
}

Expand All @@ -58,7 +58,7 @@ class ScreenTests {
snapshot(name = "CallLobby") {
CallLobby(
modifier = Modifier.fillMaxWidth(),
call = mockCall
call = previewCall
)
}
}
Expand All @@ -70,7 +70,7 @@ Let's break the code down line by line.
First, you should initialize Stream Video SDK with the `initializeStreamVideo()` method. You can learn more about our mock library on [UI Previews](07-ui-previews.mdx).

```kotlin
StreamMockUtils.initializeStreamVideo(LocalContext.current)
StreamPreviewDataUtils.initializeStreamVideo(LocalContext.current)
```

Next, you should enable `LocalInspectionMode` with the `CompositionLocalProvider` and allow Stream UI components to be rendered for the test environment.
Expand All @@ -90,7 +90,7 @@ Finally, snapshot Stream Video components or your own Composable functions that
@Test
fun `snapshot CallContent component`() {
snapshot(name = "CallContent") {
CallContent(call = mockCall)
CallContent(call = previewCall)
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ title: Overview

Push notifications can be configured to receive updates when the application is closed or on the background, or even app is in a different contextual screen. Stream Video Server sends push notification for Ringing calls and Live calls that are about to start to users that have at least one registered device.

Push notifications are sent in the following scenarios:
- you create a call with the `ring` value set to true. In this case, a notification that shows a ringing screen is sent.
- you create a call with the `notify` value set to true. In this case, a regular push notification is sent.
- you haven't answered a call. In this case, a missed call notification is sent (regular push notification).

To receive push notifications from Stream Video Server, you'll need to:

1. Configure your push notification provider on the [Stream Dashboard](https://dashboard.getstream.io/).
Expand Down
39 changes: 33 additions & 6 deletions stream-video-android-core/api/stream-video-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public final class io/getstream/video/android/core/CallState {
public final fun getErrors ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getIngress ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getLive ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getLiveDuration ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getLiveDurationInMs ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getLivestream ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getLocalParticipant ()Lkotlinx/coroutines/flow/StateFlow;
Expand Down Expand Up @@ -816,12 +817,13 @@ public final class io/getstream/video/android/core/StreamVideoBuilder {
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZ)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;Z)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;Z)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;I)V
public synthetic fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLjava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;Z)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;I)V
public synthetic fun <init> (Landroid/content/Context;Ljava/lang/String;Lio/getstream/video/android/core/GEO;Lio/getstream/video/android/model/User;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/getstream/video/android/core/logging/LoggingLevel;Lio/getstream/video/android/core/notifications/NotificationConfig;Lkotlin/jvm/functions/Function1;JZLjava/lang/String;ZLio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;Ljava/lang/String;Lio/getstream/video/android/core/sounds/Sounds;ZLio/getstream/video/android/core/permission/android/StreamPermissionCheck;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun build ()Lio/getstream/video/android/core/StreamVideo;
}

Expand Down Expand Up @@ -4138,6 +4140,7 @@ public class io/getstream/video/android/core/notifications/DefaultNotificationHa
protected final fun getNotificationManager ()Landroidx/core/app/NotificationManagerCompat;
public fun getOngoingCallNotification (Ljava/lang/String;Lio/getstream/video/android/model/StreamCallId;)Landroid/app/Notification;
public fun getRingingCallNotification (Lio/getstream/video/android/core/RingingState;Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;Z)Landroid/app/Notification;
public fun getSettingUpCallNotification ()Landroid/app/Notification;
public fun onLiveCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public fun onMissedCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public fun onNotification (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
Expand Down Expand Up @@ -4188,6 +4191,7 @@ public abstract interface class io/getstream/video/android/core/notifications/No
public abstract fun getOngoingCallNotification (Ljava/lang/String;Lio/getstream/video/android/model/StreamCallId;)Landroid/app/Notification;
public abstract fun getRingingCallNotification (Lio/getstream/video/android/core/RingingState;Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;Z)Landroid/app/Notification;
public static synthetic fun getRingingCallNotification$default (Lio/getstream/video/android/core/notifications/NotificationHandler;Lio/getstream/video/android/core/RingingState;Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;ZILjava/lang/Object;)Landroid/app/Notification;
public abstract fun getSettingUpCallNotification ()Landroid/app/Notification;
public abstract fun onLiveCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public abstract fun onMissedCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public abstract fun onNotification (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
Expand Down Expand Up @@ -4215,6 +4219,29 @@ public final class io/getstream/video/android/core/notifications/internal/receiv
public fun onReceive (Landroid/content/Context;Landroid/content/Intent;)V
}

public final class io/getstream/video/android/core/notifications/internal/service/CallServiceConfig {
public fun <init> ()V
public fun <init> (ZILjava/util/Map;)V
public synthetic fun <init> (ZILjava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Z
public final fun component2 ()I
public final fun component3 ()Ljava/util/Map;
public final fun copy (ZILjava/util/Map;)Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;
public static synthetic fun copy$default (Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;ZILjava/util/Map;ILjava/lang/Object;)Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;
public fun equals (Ljava/lang/Object;)Z
public final fun getAudioUsage ()I
public final fun getCallServicePerType ()Ljava/util/Map;
public final fun getRunCallServiceInForeground ()Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/getstream/video/android/core/notifications/internal/service/CallServiceConfigKt {
public static final fun callServiceConfig ()Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;
public static final fun livestreamCallServiceConfig ()Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;
public static final fun livestreamGuestCallServiceConfig ()Lio/getstream/video/android/core/notifications/internal/service/CallServiceConfig;
}

public final class io/getstream/video/android/core/permission/PermissionRequest {
public fun <init> (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/model/User;Lorg/threeten/bp/OffsetDateTime;Ljava/util/List;Lorg/threeten/bp/OffsetDateTime;Lorg/threeten/bp/OffsetDateTime;)V
public synthetic fun <init> (Lio/getstream/video/android/core/Call;Lio/getstream/video/android/model/User;Lorg/threeten/bp/OffsetDateTime;Ljava/util/List;Lorg/threeten/bp/OffsetDateTime;Lorg/threeten/bp/OffsetDateTime;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
32 changes: 28 additions & 4 deletions stream-video-android-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,26 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.VIBRATE" />

<!-- Call service permission -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

<!-- Optional, if incoming / outgoing calls feature is used -->
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />

<!-- If the app is only livestream host -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />

<!-- If the app is only livestream viewer/guest type -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

<!-- If the calls support screensharing -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"/>


<application>

Expand Down Expand Up @@ -83,5 +97,15 @@

<service android:name=".screenshare.StreamScreenShareService"
android:foregroundServiceType="mediaProjection"/>

<service
android:name=".notifications.internal.service.LivestreamCallService"
android:foregroundServiceType="camera|microphone"
android:exported="false" />

<service
android:name=".notifications.internal.service.LivestreamViewerService"
android:foregroundServiceType="mediaPlayback"
android:exported="false" />
</application>
</manifest>
Loading

0 comments on commit 94b4a76

Please sign in to comment.