react-native-callkeep
react-native-callkeep copied to clipboard
[IOS] Js code paused if proximity sensor closed
hello, I have a problem. If proximity sensor close fast - js code paused. Is it possible do some thing when proximity sensor close fast and screen go off? I use react-native-background-timer to work in background but it not help.
Versions
- Callkeep: "^3.0.8"
- React Native: "0.61.5"
You need to patch RN module RCTTiming.m:
- (void)setBridge:(RCTBridge *)bridge
{
...
if([[UIApplication sharedApplication] applicationState]!=UIApplicationStateActive){
_inBackground =YES;
}else{
_inBackground = NO;
}
...
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(proximityChanged)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
...
}
-(void)proximityChanged
{
BOOL state = [UIDevice currentDevice].proximityState;
if(state==YES){
[self appDidMoveToBackground];
}else{
[self appDidMoveToForeground];
}
}
instead
- (void)setBridge:(RCTBridge *)bridge
{
...
_inBackground = NO;
...
}
it works for me.
@bmp123 does this resolve you issue ? I don't think it's a callkeep issue.
Closed due to inactivity. Please reopen the issue with some logs if you still reproduce it.