Skip to content

Commit 48c6b88

Browse files
Konrad Kierusmanuquentin
authored andcommitted
Add documentation for didLoadWithEvents event
1 parent 1877abf commit 48c6b88

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,26 @@ RNCallKeep.addEventListener('didPerformDTMFAction', ({ digits, callUUID }) => {
519519
- `callUUID` (string)
520520
- The UUID of the call.
521521

522+
### - didLoadWithEvents
523+
524+
iOS only.
525+
526+
Called as soon as JS context initializes if there were some actions performed by user before JS context has been created.
527+
528+
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.
529+
530+
```js
531+
RNCallKeep.addEventListener('didLoadWithEvents', (events) => {
532+
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169
533+
});
534+
```
535+
536+
- `events` Array
537+
- `name`: string
538+
Native event name like: `RNCallKeepPerformAnswerCallAction`
539+
- `data`: object
540+
Object with data passed together with specific event so it can be handled in the same way like original event, for example `({ callUUID })` for `answerCall` event if `name` is `RNCallKeepPerformAnswerCallAction`
541+
522542
### - checkReachability
523543

524544
On Android when the application is in background, after a certain delay the OS will close every connection with informing about it.

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export type Events =
99
'didPerformDTMFAction' |
1010
'didResetProvider' |
1111
'checkReachability' |
12-
'didPerformSetMutedCallAction';
12+
'didPerformSetMutedCallAction' |
13+
'didLoadWithEvents';
1314

1415
type HandleType = 'generic' | 'number' | 'email';
1516

0 commit comments

Comments
 (0)