You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Required to get audio in background when using Android 11
52
+
foregroundService: {
53
+
channelId:'com.company.my',
54
+
channelName:'Foreground service for my app',
55
+
notificationTitle:'My app is running on background',
56
+
notificationIcon:'Path to the resource icon of the notification',
57
+
},
51
58
}
52
59
};
53
60
@@ -124,6 +131,30 @@ Eg: When your used log out (or the connection to your server is broken, etc..),
124
131
RNCallKeep.setAvailable(true);
125
132
```
126
133
134
+
### setForegroundServiceSettings
135
+
_This feature is available only on Android._
136
+
137
+
Configures the [Foreground Service](https://developer.android.com/about/versions/11/privacy/foreground-services) used for Android 11 to get microphone access on background.
138
+
Similar to set the `foregroundService` key in the `setup()` method.
139
+
140
+
```js
141
+
RNCallKeep.setForegroundServiceSettings({
142
+
channelId:'com.company.my',
143
+
channelName:'Foreground service for my app',
144
+
notificationTitle:'My app is running on background',
145
+
notificationIcon:'Path to the resource icon of the notification',
146
+
});
147
+
```
148
+
149
+
### canMakeMultipleCalls
150
+
_This feature is available only on Android._
151
+
152
+
Disable the "Add call" button in ConnectionService UI.
153
+
154
+
```js
155
+
RNCallKeep.canMakeMultipleCalls(false); // Enabled by default
- Name of the caller to be displayed on the native UI
233
271
-`handle`: string
234
272
- Phone number of the caller
273
+
-`options`: object (optional)
274
+
-`ios`: object
275
+
-`hasVideo`: boolean (optional)
276
+
-`supportsHolding`: boolean (optional)
277
+
-`supportsDTMF`: boolean (optional)
278
+
-`supportsGrouping`: boolean (optional)
279
+
-`supportsUngrouping`: boolean (optional)
280
+
-`android`: object (currently no-op)
235
281
236
282
### endCall
237
283
@@ -388,6 +434,29 @@ const options = {
388
434
RNCallKeep.hasDefaultPhoneAccount(options);
389
435
```
390
436
437
+
### checkPhoneAccountEnabled
438
+
439
+
Checks if the user has set a default [phone account](https://developer.android.com/reference/android/telecom/PhoneAccount) and it's enabled.
440
+
441
+
It's useful for custom permission prompts. It should be used in pair with `registerPhoneAccount`
442
+
Similar to `hasDefaultPhoneAccount` but without trigering a prompt if the user doesn't have a phone account.
443
+
444
+
_This feature is available only on Android._
445
+
446
+
```js
447
+
RNCallKeep.checkPhoneAccountEnabled();
448
+
```
449
+
450
+
### isConnectionServiceAvailable
451
+
452
+
Check if the device support ConnectionService.
453
+
454
+
_This feature is available only on Android._
455
+
456
+
```js
457
+
RNCallKeep.checkPhoneAccountEnabled();
458
+
```
459
+
391
460
### backToForeground
392
461
_This feature is available only on Android._
393
462
@@ -538,9 +607,14 @@ Called as soon as JS context initializes if there were some actions performed by
538
607
539
608
Since iOS 13, you must display incoming call on receiving PushKit push notification. But if app was killed, it takes some time to create JS context. If user answers the call (or ends it) before JS context has been initialized, user actions will be passed as events array of this event. Similar situation can happen if user would like to start a call from Recents or similar iOS app, assuming that your app was in killed state.
540
609
610
+
**NOTE: You still need to subscribe / handle the rest events as usuall. This is just a helper whcih cache and propagate early fired events if and only if for "the native events which DID fire BEFORE js bridge is initialed", it does NOT mean this will have events each time when the app reopened.**
611
+
541
612
```js
613
+
// register `didLoadWithEvents` somewhere early in your app when it is ready to handle callkeep events.
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169
616
+
// `events` is passed as an Array chronologically, handle or ignore events based on the app's logic
617
+
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169 or https://github.com/react-native-webrtc/react-native-callkeep/pull/205
544
618
});
545
619
```
546
620
@@ -724,7 +798,7 @@ In some case your application can be unreachable :
724
798
- when the user kill the application
725
799
- when it's in background since a long time (eg: after ~5mn the os will kill all connections).
726
800
727
-
To be able to wake up your application to display the incoming call, you can use [https://github.com/ianlin/react-native-voip-push-notification](react-native-voip-push-notification) on iOS or BackgroundMessaging from [react-native-firebase](https://rnfirebase.io/docs/v5.x.x/messaging/receiving-messages#4)-(Optional)(Android-only)-Listen-for-FCM-messages-in-the-background).
801
+
To be able to wake up your application to display the incoming call, you can use [https://github.com/ianlin/react-native-voip-push-notification](react-native-voip-push-notification) on iOS or BackgroundMessaging from [react-native-firebase](https://rnfirebase.io/messaging/usage#receiving-messages)-(Optional)(Android-only)-Listen-for-FCM-messages-in-the-background).
728
802
729
803
You have to send a push to your application, like with Firebase for Android and with a library supporting PushKit pushes for iOS.
730
804
@@ -743,10 +817,28 @@ Since iOS 13, you'll have to report the incoming calls that wakes up your applic
743
817
// NSString *handle = @"caller number here";
744
818
// NSDictionary *extra = [payload.dictionaryPayload valueForKeyPath:@"custom.path.to.data"]; /* use this to pass any special data (ie. from your notification) down to RN. Can also be `nil`*/
Since Android 11, your application [requires to start a foregroundService](https://developer.android.com/about/versions/11/privacy/foreground-services) in order to access the microphone in background.
838
+
You'll need to upgrade your `compileSdkVersion` to `30` to be able to use this feature.
839
+
840
+
You have to set the `foregroundService` key in the [`setup()`](#setup) method and add a `foregroundServiceType` in the [`AndroidManifest` file](docs/android-installation.md#android-common-step-installation).
0 commit comments