Skip to content

Commit 001c79b

Browse files
committed
fix: not to add didLoadWithEvents in constructor
1 parent 3bcd5ea commit 001c79b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,11 @@ Called as soon as JS context initializes if there were some actions performed by
571571
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.
572572

573573
```js
574+
// register `didLoadWithEvents` somewhere early in your app when it is ready to handle callkeep events.
575+
574576
RNCallKeep.addEventListener('didLoadWithEvents', (events) => {
575-
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169
577+
// `events` is passed as an Array chronologically, handle or ignore events based on the app's logic
578+
// see example usage in https://github.com/react-native-webrtc/react-native-callkeep/pull/169 or https://github.com/react-native-webrtc/react-native-callkeep/pull/205
576579
});
577580
```
578581

index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ class RNCallKeep {
2222

2323
constructor() {
2424
this._callkeepEventHandlers = new Map();
25-
26-
this.addEventListener('didLoadWithEvents', (events) => {
27-
events.forEach(event => {
28-
emit(event.name, event.data);
29-
});
30-
});
3125
}
3226

3327
addEventListener = (type, handler) => {

0 commit comments

Comments
 (0)