RNPBackgroundRefresh.m 691B

1234567891011121314151617181920212223242526272829
  1. //
  2. // RNPBackgroundRefresh.m
  3. // ReactNativePermissions
  4. //
  5. // Created by Yonah Forst on 11/07/16.
  6. // Copyright © 2016 Yonah Forst. All rights reserved.
  7. //
  8. #import "RNPBackgroundRefresh.h"
  9. @implementation RNPBackgroundRefresh
  10. +(NSString *)getStatus
  11. {
  12. int status = [[UIApplication sharedApplication] backgroundRefreshStatus];
  13. switch (status) {
  14. case UIBackgroundRefreshStatusAvailable:
  15. return RNPStatusAuthorized;
  16. case UIBackgroundRefreshStatusDenied:
  17. return RNPStatusDenied;
  18. case UIBackgroundRefreshStatusRestricted:
  19. return RNPStatusRestricted;
  20. default:
  21. return RNPStatusUndetermined;
  22. }
  23. }
  24. @end