diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index c3b0b6a04..57c1fe42e 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ package="io.agora.agora_rtc_ng_example"> + + + = Build.VERSION_CODES.R) { + startForeground( + NOTIFICATION_ID_DAEMON_SERVICE, + notificationBuilder.build(), + ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE xor ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK) + } else { + startForeground(NOTIFICATION_ID_DAEMON_SERVICE, notificationBuilder.build()) + } } private fun getContentIntent(): PendingIntent? { diff --git a/example/lib/main.dart b/example/lib/main.dart index e9f0b7abc..9549778d5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -46,7 +46,7 @@ class _MyAppState extends State { Future _requestPermissionIfNeed() async { if (defaultTargetPlatform == TargetPlatform.android) { - await [Permission.microphone, Permission.camera].request(); + await [Permission.audio, Permission.microphone, Permission.camera].request(); } }