Skip to content

Commit 9d73892

Browse files
author
Brandon Huang
committed
Merge branch 'master' into endAllCallsAndroid
2 parents b5e3ec7 + e2cffa8 commit 9d73892

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ RNCallKeep.displayIncomingCall(uuid, handle, localizedCallerName);
137137
- `false` (default)
138138
- `true` (you know... when not false)
139139

140+
### answerIncomingCall
141+
_This feature is available only on Android._
142+
143+
Use this to tell the sdk a user answered a call from the app UI.
144+
145+
```js
146+
RNCallKeep.answerIncomingCall(uuid)
147+
```
148+
- `uuid`: string
149+
- The `uuid` used for `startCall` or `displayIncomingCall`
150+
140151

141152
### startCall
142153

@@ -204,6 +215,17 @@ End all ongoing connections.
204215
RNCallKeep.endAllCalls();
205216
```
206217

218+
### rejectCall
219+
220+
When you reject an incoming call.
221+
222+
```js
223+
RNCallKeep.rejectCall(uuid);
224+
```
225+
226+
- `uuid`: string
227+
- The `uuid` used for `startCall` or `displayIncomingCall`
228+
207229
### reportEndCallWithUUID
208230

209231
Report that the call ended without the user initiating

index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class RNCallKeep {
5555
};
5656

5757
answerIncomingCall = (uuid) => {
58-
RNCallKeepModule.answerIncomingCall(uuid)
58+
if (!isIOS) {
59+
RNCallKeepModule.answerIncomingCall(uuid);
60+
}
5961
}
6062

6163
startCall = (uuid, handle, contactIdentifier, handleType = 'number', hasVideo = false ) => {
@@ -85,8 +87,16 @@ class RNCallKeep {
8587
RNCallKeepModule.reportEndCallWithUUID(uuid, reason);
8688
}
8789

90+
/*
91+
* Android explicitly states we reject a call
92+
* On iOS we just notify of an endCall
93+
*/
8894
rejectCall = (uuid) => {
89-
RNCallKeepModule.rejectCall(uuid);
95+
if (!isIOS) {
96+
RNCallKeepModule.rejectCall(uuid);
97+
} else {
98+
RNCallKeepModule.endCall(uuid);
99+
}
90100
}
91101

92102
endCall = (uuid) => {

0 commit comments

Comments
 (0)