RCTConvert+RNPermission.m 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #import "RCTConvert+RNPermission.h"
  2. @implementation RCTConvert(RNPermission)
  3. RCT_ENUM_CONVERTER(RNPermission, (@{
  4. #if __has_include("RNPermissionHandlerBluetoothPeripheral.h")
  5. @"BLUETOOTH_PERIPHERAL": @(RNPermissionBluetoothPeripheral),
  6. #endif
  7. #if __has_include("RNPermissionHandlerCalendars.h")
  8. @"CALENDARS": @(RNPermissionCalendars),
  9. #endif
  10. #if __has_include("RNPermissionHandlerCamera.h")
  11. @"CAMERA": @(RNPermissionCamera),
  12. #endif
  13. #if __has_include("RNPermissionHandlerContacts.h")
  14. @"CONTACTS": @(RNPermissionContacts),
  15. #endif
  16. #if __has_include("RNPermissionHandlerFaceID.h")
  17. @"FACE_ID": @(RNPermissionFaceID),
  18. #endif
  19. #if __has_include("RNPermissionHandlerLocationAlways.h")
  20. @"LOCATION_ALWAYS": @(RNPermissionLocationAlways),
  21. #endif
  22. #if __has_include("RNPermissionHandlerLocationWhenInUse.h")
  23. @"LOCATION_WHEN_IN_USE": @(RNPermissionLocationWhenInUse),
  24. #endif
  25. #if __has_include("RNPermissionHandlerMediaLibrary.h")
  26. @"MEDIA_LIBRARY": @(RNPermissionMediaLibrary),
  27. #endif
  28. #if __has_include("RNPermissionHandlerMicrophone.h")
  29. @"MICROPHONE": @(RNPermissionMicrophone),
  30. #endif
  31. #if __has_include("RNPermissionHandlerMotion.h")
  32. @"MOTION": @(RNPermissionMotion),
  33. #endif
  34. #if __has_include("RNPermissionHandlerNotifications.h")
  35. @"NOTIFICATIONS": @(RNPermissionNotifications),
  36. #endif
  37. #if __has_include("RNPermissionHandlerPhotoLibrary.h")
  38. @"PHOTO_LIBRARY": @(RNPermissionPhotoLibrary),
  39. #endif
  40. #if __has_include("RNPermissionHandlerReminders.h")
  41. @"REMINDERS": @(RNPermissionReminders),
  42. #endif
  43. #if __has_include("RNPermissionHandlerSiri.h")
  44. @"SIRI": @(RNPermissionSiri),
  45. #endif
  46. #if __has_include("RNPermissionHandlerSpeechRecognition.h")
  47. @"SPEECH_RECOGNITION": @(RNPermissionSpeechRecognition),
  48. #endif
  49. #if __has_include("RNPermissionHandlerStoreKit.h")
  50. @"STOREKIT": @(RNPermissionStoreKit),
  51. #endif
  52. }),
  53. RNPermissionUnknown, integerValue
  54. )
  55. @end