We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
_listenerCount
1 parent 3e9a3ed commit 06cb30dCopy full SHA for 06cb30d
1 file changed
ios/RNCallKeep/RNCallKeep.m
@@ -131,6 +131,17 @@ - (void)startObserving
131
- (void)stopObserving
132
{
133
_hasListeners = FALSE;
134
+
135
+ // Fix for https://github.com/react-native-webrtc/react-native-callkeep/issues/406
136
+ // We use Objective-C Key Value Coding(KVC) to sync _RTCEventEmitter_ `_listenerCount`.
137
+ @try {
138
+ [self setValue:@0 forKey:@"_listenerCount"];
139
+ }
140
+ @catch ( NSException *e ){
141
+ NSLog(@"[RNCallKeep][stopObserving] exception: %@",e);
142
+ NSLog(@"[RNCallKeep][stopObserving] RNCallKeep parent class RTCEventEmitter might have a broken state.");
143
+ NSLog(@"[RNCallKeep][stopObserving] Please verify that the parent RTCEventEmitter.m has iVar `_listenerCount`.");
144
145
}
146
147
- (void)onAudioRouteChange:(NSNotification *)notification
0 commit comments