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
If provided, it will be played when incoming calls received; the system will use the default ringtone if this is not provided
65
72
-`includesCallsInRecents`: boolean (optional)
66
-
If provided, calls will be shown in the recent calls when true and not when false (ios 11 and above)
73
+
If provided, calls will be shown in the recent calls when true and not when false (ios 11 and above) (Default: true)
67
74
-`maximumCallGroups`: string (optional)
68
75
If provided, the maximum number of call groups supported by this application (Default: 3)
69
76
-`maximumCallsPerCallGroup`: string (optional)
@@ -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
290
-`handle`: string
234
291
- Phone number of the caller
292
+
-`options`: object (optional)
293
+
-`ios`: object
294
+
-`hasVideo`: boolean (optional)
295
+
-`supportsHolding`: boolean (optional)
296
+
-`supportsDTMF`: boolean (optional)
297
+
-`supportsGrouping`: boolean (optional)
298
+
-`supportsUngrouping`: boolean (optional)
299
+
-`android`: object (currently no-op)
235
300
236
301
### endCall
237
302
@@ -388,6 +453,29 @@ const options = {
388
453
RNCallKeep.hasDefaultPhoneAccount(options);
389
454
```
390
455
456
+
### checkPhoneAccountEnabled
457
+
458
+
Checks if the user has set a default [phone account](https://developer.android.com/reference/android/telecom/PhoneAccount) and it's enabled.
459
+
460
+
It's useful for custom permission prompts. It should be used in pair with `registerPhoneAccount`
461
+
Similar to `hasDefaultPhoneAccount` but without trigering a prompt if the user doesn't have a phone account.
462
+
463
+
_This feature is available only on Android._
464
+
465
+
```js
466
+
RNCallKeep.checkPhoneAccountEnabled();
467
+
```
468
+
469
+
### isConnectionServiceAvailable
470
+
471
+
Check if the device support ConnectionService.
472
+
473
+
_This feature is available only on Android._
474
+
475
+
```js
476
+
RNCallKeep.checkPhoneAccountEnabled();
477
+
```
478
+
391
479
### backToForeground
392
480
_This feature is available only on Android._
393
481
@@ -538,9 +626,14 @@ Called as soon as JS context initializes if there were some actions performed by
538
626
539
627
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
628
629
+
**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.**
630
+
541
631
```js
632
+
// 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
635
+
// `events` is passed as an Array chronologically, handle or ignore events based on the app's logic
636
+
// 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
637
});
545
638
```
546
639
@@ -724,7 +817,7 @@ In some case your application can be unreachable :
724
817
- when the user kill the application
725
818
- when it's in background since a long time (eg: after ~5mn the os will kill all connections).
726
819
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).
820
+
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
821
729
822
You have to send a push to your application, like with Firebase for Android and with a library supporting PushKit pushes for iOS.
730
823
@@ -743,10 +836,28 @@ Since iOS 13, you'll have to report the incoming calls that wakes up your applic
743
836
// NSString *handle = @"caller number here";
744
837
// 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.
857
+
You'll need to upgrade your `compileSdkVersion` to `30` to be able to use this feature.
858
+
859
+
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