You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Proximity.m 599B

123456789101112131415161718192021222324
  1. #import "RCTBridgeModule.h"
  2. #import <UIKit/UIKit.h>
  3. @interface Proximity : NSObject<RCTBridgeModule>
  4. @end
  5. @implementation Proximity
  6. RCT_EXPORT_MODULE();
  7. /**
  8. * Enables / disables the proximity sensor monitoring. On iOS enabling the
  9. * proximity sensor automatically dims the screen and disables touch controls,
  10. * so there is nothing else to do (unlike on Android)!
  11. *
  12. * @param enabled {@code YES} to enable proximity (sensor) monitoring;
  13. * {@code NO}, otherwise.
  14. */
  15. RCT_EXPORT_METHOD(setEnabled:(BOOL)enabled) {
  16. [[UIDevice currentDevice] setProximityMonitoringEnabled:enabled];
  17. }
  18. @end