Skip to content

Commit

Permalink
Add documentation for didLoadWithEvents event
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Kierus authored and manuquentin committed May 28, 2020
1 parent 1877abf commit 48c6b88
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,26 @@ RNCallKeep.addEventListener('didPerformDTMFAction', ({ digits, callUUID }) => {
- `callUUID` (string)
- The UUID of the call.

### - didLoadWithEvents

iOS only.

Called as soon as JS context initializes if there were some actions performed by user before JS context has been created.

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.

```js
RNCallKeep.addEventListener('didLoadWithEvents', (events) => {
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169
});
```

- `events` Array
- `name`: string
Native event name like: `RNCallKeepPerformAnswerCallAction`
- `data`: object
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`

### - checkReachability

On Android when the application is in background, after a certain delay the OS will close every connection with informing about it.
Expand Down
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export type Events =
'didPerformDTMFAction' |
'didResetProvider' |
'checkReachability' |
'didPerformSetMutedCallAction';
'didPerformSetMutedCallAction' |
'didLoadWithEvents';

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

Expand Down

0 comments on commit 48c6b88

Please sign in to comment.