Ei kuvausta

RNIdle.m 575B

1234567891011121314151617181920212223242526272829
  1. //
  2. // RNIdle.m
  3. // RNIdle
  4. //
  5. // Created by lcj on 9/17/16.
  6. // Copyright © 2016 lcj. All rights reserved.
  7. //
  8. #import "RNIdle.h"
  9. @implementation RNIdle
  10. RCT_EXPORT_MODULE();
  11. RCT_EXPORT_METHOD(disableIdleTimer)
  12. {
  13. // DON'T let the device go to sleep during our sync
  14. [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
  15. [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
  16. }
  17. RCT_EXPORT_METHOD(enableIdleTimer)
  18. {
  19. // DON'T let the device go to sleep during our sync
  20. [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
  21. }
  22. @end