Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed May 17, 2024
2 parents d7b15aa + a354159 commit 448590e
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 102 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 = 0
const val patchVersion = 1
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 23
const val versionCode = 24
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.1.0"
const val streamVideoCallGooglePlayVersion = "1.1.1"
const val streamWebRtcVersionName = "1.1.1"
}
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/01-video-calling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```kotlin
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:1.0.0")
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")

// Optionally add Jetpack Compose if Android studio didn't automatically include them
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/02-audio-room.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```groovy
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:1.0.0")
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/02-tutorials/03-livestream.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
```kotlin
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:1.0.0")
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")

// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Let the project sync. It should have all the dependencies required for you to fi
```groovy
dependencies {
// Stream Video Compose SDK
implementation("io.getstream:stream-video-android-ui-compose:1.0.0")
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
// Stream Chat
implementation(libs.stream.chat.compose)
Expand Down
5 changes: 3 additions & 2 deletions stream-video-android-core/api/stream-video-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -4085,7 +4085,7 @@ public class io/getstream/video/android/core/notifications/DefaultNotificationHa
public final fun getHideRingingNotificationInForeground ()Z
public final fun getNotificationIconRes ()I
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;)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 onLiveCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public fun onNotification (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public fun onPermissionDenied ()V
Expand Down Expand Up @@ -4132,7 +4132,8 @@ public abstract interface class io/getstream/video/android/core/notifications/No
public static final field INTENT_EXTRA_CALL_DISPLAY_NAME Ljava/lang/String;
public static final field INTENT_EXTRA_NOTIFICATION_ID Ljava/lang/String;
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;)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 onLiveCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public abstract fun onNotification (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
public abstract fun onRingingCall (Lio/getstream/video/android/model/StreamCallId;Ljava/lang/String;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import androidx.annotation.DrawableRes
import androidx.core.app.NotificationChannelCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationCompat.CallStyle
import androidx.core.app.NotificationManagerCompat
import androidx.core.app.Person
import androidx.core.content.ContextCompat
import io.getstream.android.push.permissions.DefaultNotificationPermissionHandler
import io.getstream.android.push.permissions.NotificationPermissionHandler
import io.getstream.log.TaggedLogger
Expand Down Expand Up @@ -85,19 +86,15 @@ public open class DefaultNotificationHandler(
}

override fun onRingingCall(callId: StreamCallId, callDisplayName: String) {
val serviceIntent = CallService.buildStartIntent(
this.application,
callId,
CallService.TRIGGER_INCOMING_CALL,
callDisplayName,
)
ContextCompat.startForegroundService(application.applicationContext, serviceIntent)
Log.d("ServiceDebug", "[onRingingCall] callId: ${callId.id}")
CallService.showIncomingCall(application, callId, callDisplayName)
}

override fun getRingingCallNotification(
ringingState: RingingState,
callId: StreamCallId,
callDisplayName: String,
shouldHaveContentIntent: Boolean,
): Notification? {
return if (ringingState is RingingState.Incoming) {
val fullScreenPendingIntent = intentResolver.searchIncomingCallPendingIntent(callId)
Expand All @@ -110,6 +107,7 @@ public open class DefaultNotificationHandler(
acceptCallPendingIntent,
rejectCallPendingIntent,
callDisplayName,
shouldHaveContentIntent,
)
} else {
logger.e { "Ringing call notification not shown, one of the intents is null." }
Expand Down Expand Up @@ -139,6 +137,7 @@ public open class DefaultNotificationHandler(
acceptCallPendingIntent: PendingIntent,
rejectCallPendingIntent: PendingIntent,
callDisplayName: String,
shouldHaveContentIntent: Boolean,
): Notification {
// if the app is in foreground then don't interrupt the user with a high priority
// notification (popup). The application will display an incoming ringing call
Expand Down Expand Up @@ -182,9 +181,20 @@ public open class DefaultNotificationHandler(
setContentText(callDisplayName)
setChannelId(channelId)
setOngoing(false)
setContentIntent(fullScreenPendingIntent)
setFullScreenIntent(fullScreenPendingIntent, true)
setCategory(NotificationCompat.CATEGORY_CALL)
setFullScreenIntent(fullScreenPendingIntent, true)
if (shouldHaveContentIntent) {
setContentIntent(fullScreenPendingIntent)
} else {
val emptyIntent = PendingIntent.getActivity(
application,
0,
Intent(),
PendingIntent.FLAG_IMMUTABLE,
)
setContentIntent(emptyIntent)
setAutoCancel(false)
}
addCallActions(acceptCallPendingIntent, rejectCallPendingIntent, callDisplayName)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public interface NotificationHandler : NotificationPermissionHandler {
ringingState: RingingState,
callId: StreamCallId,
callDisplayName: String,
shouldHaveContentIntent: Boolean = true,
): Notification?

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal object NoOpNotificationHandler : NotificationHandler {
ringingState: RingingState,
callId: StreamCallId,
callDisplayName: String,
shouldHaveContentIntent: Boolean,
): Notification? = null

override fun onPermissionDenied() { /* NoOp */ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ package io.getstream.video.android.core.notifications.internal.receivers

import android.content.Context
import android.content.Intent
import androidx.core.app.NotificationManagerCompat
import android.util.Log
import io.getstream.log.taggedLogger
import io.getstream.result.Result
import io.getstream.video.android.core.Call
import io.getstream.video.android.core.notifications.NotificationHandler
import io.getstream.video.android.core.notifications.NotificationHandler.Companion.ACTION_REJECT_CALL
import io.getstream.video.android.core.notifications.internal.service.CallService
import io.getstream.video.android.model.StreamCallId

/**
* Used to process any pending intents that feature the [ACTION_REJECT_CALL] action. By consuming this
Expand All @@ -41,12 +41,7 @@ internal class RejectCallBroadcastReceiver : GenericCallActionBroadcastReceiver(
is Result.Success -> logger.d { "[onReceive] rejectCall, Success: $rejectResult" }
is Result.Failure -> logger.d { "[onReceive] rejectCall, Failure: $rejectResult" }
}
val serviceIntent = CallService.buildStopIntent(context)
context.stopService(serviceIntent)

// As a second precaution cancel also the notification
NotificationManagerCompat.from(
context,
).cancel(NotificationHandler.INCOMING_CALL_NOTIFICATION_ID)
Log.d("ServiceDebug", "[reject onReceive] callId: ${call.id}")
CallService.removeIncomingCall(context, StreamCallId.fromCallCid(call.cid))
}
}
Loading

0 comments on commit 448590e

Please sign in to comment.