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
Copy file name to clipboardExpand all lines: README.md
+66-12Lines changed: 66 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -90,9 +90,10 @@ RNCallKeep.setup(options);
90
90
### setAvailable
91
91
_This feature is available only on Android._
92
92
93
-
Tell _ConnectionService_ that the device is ready to make outgoing calls.
93
+
Tell _ConnectionService_ that the device is ready to make outgoing calls via the native Phone app.
94
94
If not the user will be stuck in the build UI screen without any actions.
95
-
Eg: Call it with `false` when disconnected from the sip client, when your token expires ...
95
+
Eg: Call it with `false` when disconnected from the sip client, when your token expires, when your user log out ...
96
+
Eg: When your used log out (or the connection to your server is broken, etc..), you have to call `setAvailable(false)` so CallKeep will refuse the call and your user will not be stuck in the native UI.
- The `uuid` used for `startCall` or `displayIncomingCall`
191
+
-`displayName`: string (optional)
192
+
- Name of the caller to be displayed on the native UI
193
193
-`handle`: string
194
194
- Phone number of the caller
195
-
-`localizedCallerName`: string (optional)
196
-
- Name of the caller to be displayed on the native UI
197
-
198
195
199
196
### endCall
200
197
@@ -324,6 +321,20 @@ _This feature is available only on Android._
324
321
awaitRNCallKeep.hasPhoneAccount();
325
322
```
326
323
324
+
### hasOutgoingCall (async)
325
+
326
+
_This feature is available only on Android, useful when waking up the application for an outgoing call._
327
+
328
+
When waking up the Android application in background mode (eg: when the application is killed and the user make a call from the native Phone application).
329
+
The user can hang up the call before your application has been started in background mode, and you can lost the `RNCallKeepPerformEndCallAction` event.
330
+
331
+
To be sure that the outgoing call is still here, you can call `hasOutgoingCall` when you app waken up.
@@ -564,7 +588,7 @@ class RNCallKeepExample extends React.Component {
564
588
onDTMFAction= (data) => {
565
589
let { digits, callUUID } = data;
566
590
// Called when the system or user performs a DTMF action
567
-
}
591
+
};
568
592
569
593
audioSessionActivated= (data) => {
570
594
// you might want to do following things when receiving this event:
@@ -584,6 +608,36 @@ class RNCallKeepExample extends React.Component {
584
608
}
585
609
```
586
610
611
+
## Receiving a call when the application is not reachable.
612
+
613
+
In some case your application can be unreachable :
614
+
- when the user kill the application
615
+
- when it's in background since a long time (eg: after ~5mn the os will kill all connections).
616
+
617
+
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).
618
+
619
+
You have to send a push to your application, like with Firebase for Android and with a library supporting PushKit pushes for iOS.
620
+
621
+
### PushKit
622
+
623
+
Since iOS 13, you'll have to report the incoming calls that wakes up your application with a VoIP push. Add this in your `AppDelegate.m` if you're using VoIP pushes to wake up your application :
0 commit comments