Skip to content

Commit 3ca320f

Browse files
committed
Document the use of foregroundServiceType in Android < 11
1 parent bd2adb2 commit 3ca320f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/android-installation.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public class MainActivity extends ReactActivity {
6060

6161
1. In `android/app/src/main/AndroidManifest.xml` add these permissions:
6262

63-
6463
```xml
6564
<uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE"/>
6665
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
@@ -72,7 +71,12 @@ public class MainActivity extends ReactActivity {
7271
<service android:name="io.wazo.callkeep.VoiceConnectionService"
7372
android:label="Wazo"
7473
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
75-
android:foregroundServiceType="camera|microphone">>
74+
// Use this to target android >= 11
75+
android:foregroundServiceType="camera|microphone"
76+
// For android < 11
77+
android:foregroundServiceType="phoneCall"
78+
>
79+
7680
<intent-filter>
7781
<action android:name="android.telecom.ConnectionService" />
7882
</intent-filter>
@@ -81,6 +85,8 @@ public class MainActivity extends ReactActivity {
8185
</application>
8286
```
8387

88+
Beware to choose the right `foregroundServiceType` depending on the version of Android you want to target.
89+
8490
2. To be able to wake up your killed application when making an outgoing call form the native Phone application:
8591

8692
Add this in the `application` node of `android/app/src/main/AndroidManifest.xml` :

0 commit comments

Comments
 (0)