Skip to content

Commit dbfccc2

Browse files
author
Joao Mesquita
committed
Make sure we pass the callUUID on most event handlers
1 parent d9e46f7 commit dbfccc2

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,26 @@ After all works are done, remember to call `RNCallKit.startCall(uuid, calleeNumb
148148
User answer the incoming call
149149

150150
Do your normal `Answering` actions here
151+
**data**:
152+
153+
```javascript
154+
{
155+
callUUID: 'f0ee907b-6dbd-45a8-858a-903decb198f8' // The UUID of the call that is to be answered
156+
}
157+
```
151158

152159
### - endCall
153160

154161
User finish the call
155162

156163
Do your normal `Hang Up` actions here
164+
**data**:
165+
166+
```javascript
167+
{
168+
callUUID: 'f0ee907b-6dbd-45a8-858a-903decb198f8' // The UUID of the call that is to be hung
169+
}
170+
```
157171

158172
### - didActivateAudioSession
159173

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export default class RNCallKit {
2929
} else if (type === 'answerCall') {
3030
listener = _RNCallKitEmitter.addListener(
3131
RNCallKitPerformAnswerCallAction,
32-
() => { handler();}
32+
(data) => { handler(data);}
3333
);
3434
} else if (type === 'endCall') {
3535
listener = _RNCallKitEmitter.addListener(
3636
RNCallKitPerformEndCallAction,
37-
() => { handler(); }
37+
(data) => { handler(data); }
3838
);
3939
} else if (type === 'didActivateAudioSession') {
4040
listener = _RNCallKitEmitter.addListener(

ios/RNCallKit/RNCallKit.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ - (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAct
356356
if (![self lessThanIos10_2]) {
357357
[self configureAudioSession];
358358
}
359-
[self sendEventWithName:RNCallKitPerformAnswerCallAction body:nil];
359+
[self sendEventWithName:RNCallKitPerformAnswerCallAction body:@{ @"callUUID": action.callUUID.UUIDString }];
360360
[action fulfill];
361361
}
362362

@@ -366,7 +366,7 @@ - (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)
366366
#ifdef DEBUG
367367
NSLog(@"[RNCallKit][CXProviderDelegate][provider:performEndCallAction]");
368368
#endif
369-
[self sendEventWithName:RNCallKitPerformEndCallAction body:nil];
369+
[self sendEventWithName:RNCallKitPerformEndCallAction body:@{ @"callUUID": action.callUUID.UUIDString }];
370370
[action fulfill];
371371
}
372372

0 commit comments

Comments
 (0)