Skip to content

Commit 8e9cc0f

Browse files
authored
fix(Android): Added method to ensure lock screen permission on Android (#814)
* Added method to ensure lock screen permission on Android * added changelog * renamed ensure method
1 parent a1f61e8 commit 8e9cc0f

File tree

16 files changed

+206
-11
lines changed

16 files changed

+206
-11
lines changed

dogfooding/lib/screens/home_screen.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'package:flutter_dogfooding/widgets/stream_button.dart';
1313
import 'package:stream_video_flutter/stream_video_flutter.dart';
1414
import 'package:stream_video_flutter/stream_video_flutter_background.dart';
1515
import 'package:permission_handler/permission_handler.dart';
16+
import 'package:stream_video_push_notification/stream_video_push_notification.dart';
1617

1718
import '../app/user_auth_controller.dart';
1819
import '../di/injector.dart';
@@ -43,6 +44,8 @@ class _HomeScreenState extends State<HomeScreen> {
4344
Permission.microphone,
4445
].request();
4546

47+
StreamVideoPushNotificationManager.ensureFullScreenIntentPermission();
48+
4649
StreamBackgroundService.init(
4750
StreamVideo.instance,
4851
onButtonClick: (call, type, serviceType) async {

packages/stream_video/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
✅ Added
44
* Added the 'call.collectUserFeedback()' method which allows users to send call quality rating. These ratings are visible on the Dashboard and are aggregated in call stats for easy tracking. For a sample implementation, please refer to the [cookbook](https://getstream.io/video/docs/flutter/ui-cookbook/call-quality-rating/).
5+
* Added device thermal status reporting to better optimize call quality.
56

67
## 0.6.0
78

packages/stream_video_flutter/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
✅ Added
44
* Added the 'call.collectUserFeedback()' method which allows users to send call quality rating. These ratings are visible on the Dashboard and are aggregated in call stats for easy tracking. For a sample implementation, please refer to the [cookbook](https://getstream.io/video/docs/flutter/ui-cookbook/call-quality-rating/).
5+
* Added device thermal status reporting to better optimize call quality.
6+
* Added the `StreamVideoPushNotificationManager.ensureFullScreenIntentPermission()` method. This resolves an issue on some Android 14 devices where full-screen notifications would not appear due to missing permissions.
7+
You can now invoke this method to show a settings screen, allowing users to enable the required permission if it's not already enabled.
8+
9+
🐞 Fixed
10+
* Resolved an issue where CallKit calls would not connect when accepted while the screen was locked.
11+
* Fixed a bug where the Android foreground service would not stop when the app was killed, keeping the call connection active.
512

613
## 0.6.0
714

packages/stream_video_push_notification/.metadata

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "2f708eb8396e362e280fac22cf171c2cb467343c"
7+
revision: "2663184aa79047d0a33a14a3b607954f8fdd8730"
88
channel: "stable"
99

1010
project_type: plugin
@@ -13,11 +13,14 @@ project_type: plugin
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
17-
base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
16+
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
17+
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
18+
- platform: android
19+
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
20+
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
1821
- platform: ios
19-
create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
20-
base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
22+
create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
23+
base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
2124

2225
# User provided section
2326

packages/stream_video_push_notification/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## Unreleased
2+
3+
✅ Added
4+
* Added the `StreamVideoPushNotificationManager.ensureFullScreenIntentPermission()` method. This resolves an issue on some Android 14 devices where full-screen notifications would not appear due to missing permissions.
5+
You can now invoke this method to show a settings screen, allowing users to enable the required permission if it's not already enabled.
6+
7+
🐞 Fixed
8+
* Resolved an issue where CallKit calls would not connect when accepted while the screen was locked.
9+
110
## 0.6.0
211

312
🔄 Dependency updates
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
buildscript {
2+
ext.kotlin_version = "1.9.10"
3+
repositories {
4+
google()
5+
mavenCentral()
6+
}
7+
8+
dependencies {
9+
classpath("com.android.tools.build:gradle:7.3.1")
10+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
11+
}
12+
}
13+
14+
allprojects {
15+
repositories {
16+
google()
17+
mavenCentral()
18+
}
19+
}
20+
21+
apply plugin: "com.android.library"
22+
apply plugin: "kotlin-android"
23+
24+
android {
25+
if (project.android.hasProperty("namespace")) {
26+
namespace = "com.example.stream_video_push_notification"
27+
}
28+
29+
compileSdk = 34
30+
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = JavaVersion.VERSION_1_8
38+
}
39+
40+
sourceSets {
41+
main.java.srcDirs += "src/main/kotlin"
42+
test.java.srcDirs += "src/test/kotlin"
43+
}
44+
45+
defaultConfig {
46+
minSdk = 21
47+
}
48+
49+
dependencies {
50+
testImplementation("org.jetbrains.kotlin:kotlin-test")
51+
testImplementation("org.mockito:mockito-core:5.0.0")
52+
}
53+
54+
testOptions {
55+
unitTests.all {
56+
useJUnitPlatform()
57+
58+
testLogging {
59+
events "passed", "skipped", "failed", "standardOut", "standardError"
60+
outputs.upToDateWhen {false}
61+
showStandardStreams = true
62+
}
63+
}
64+
}
65+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
5+
networkTimeout=10000
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'stream_video_push_notification'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.stream_video_push_notification">
3+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
4+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
5+
</manifest>

0 commit comments

Comments
 (0)