react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Fixes issue 406: Use Objective-C Key Value Coding(KVC) to sync _RTCEventEmitter_ `_listenerCount`.

Open glesperance opened this issue 2 years ago • 5 comments

Fixes issue 406: Use Objective-C Key Value Coding(KVC) to sync RTCEventEmitter _listenerCount. (see https://github.com/react-native-webrtc/react-native-callkeep/issues/406).

Here we use KVC to synchronize RTCEventEmitter _listenerCount to make sure it is always valid, and that we don't end up a broken & invalid state.

glesperance avatar May 03 '22 16:05 glesperance

@Romick2005 Any thoughts on this?

glesperance avatar May 03 '22 17:05 glesperance

I am not big expert in Objective-C. So if you are able to modify _listenerCount private variable of the RCTEventEmitter class, and it works, than it is good. I had some doubts that those variable is accessible for ancestor classes, but as I said, if it really updates it, then it is ok.

Romick2005 avatar May 03 '22 18:05 Romick2005

how do we use this ? We're having an issue where on app install, CodePush updates the app and kills the event listeners.

frozencap avatar Sep 12 '22 18:09 frozencap

~~@shawarmaz this turned out not to be linked to code-push.~~

glesperance avatar Sep 12 '22 18:09 glesperance

@shawarmaz To be honest I don't have a clear memory of this bug as it was many months ago. If you want to try this fix you can either use patch-package with the code contained in this PR -or- you could point your package.json to https://github.com/Paltap-io/react-native-callkeep

I can't make any promises but at the moment the only difference between that branch and upstream is this PR.

glesperance avatar Sep 12 '22 18:09 glesperance

Thanks @glesperance tested it, works perfectly.

manuquentin avatar Aug 04 '23 14:08 manuquentin