diff --git a/RNProximity/RNProximity/RNProximity.m b/RNProximity/RNProximity/RNProximity.m index f0f4d1c..bead212 100644 --- a/RNProximity/RNProximity/RNProximity.m +++ b/RNProximity/RNProximity/RNProximity.m @@ -37,7 +37,9 @@ - (void)sensorStateChange:(NSNotificationCenter *)notification RCT_EXPORT_MODULE(); RCT_EXPORT_METHOD(proximityEnabled:(BOOL)enabled) { + dispatch_async(dispatch_get_main_queue(), ^{ [[UIDevice currentDevice] setProximityMonitoringEnabled:enabled]; + }); } @end