Set up react-native-permissions for NX repo

845 Views Asked by At

I'm having trouble setting up react-native-permissions for the NX repo

I added reactNativePermissionsIOS in package.json but when run app show "no permission handler detected". I am in react-native 0.71.11 and Xcode 14.3.

1

There are 1 best solutions below

1
David Gettins On

I managed to get this working by putting the reactNativePermissionsIOS section in the app's package.json, changing to that directory then running the command: npx react-native setup-ios-permissions as stated here.

From what I can infer, the command actually modifies the react-native-permissions RNPermissions.podspec file line 17. For my use case I needed "Notifications". Below you can see how the podspec was modified by appending , "ios/Notifications/*.{h,m,mm}".

s.source_files = "ios/*.{h,m,mm}", "ios/Notifications/*.{h,m,mm}"

Related Questions in REACT-NATIVE-PERMISSIONS