In my project, I am trying to add the following pods:
Permission-Microphone, Permission-Camera, and Permission-PhotoLibrary
. However, I encounter an error when running
pod install
.
Here is my Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, 14.0
prepare_react_native_project!
use_frameworks! :linkage => :static
# Define the node_require function
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
# Use node_require to include necessary scripts
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
setup_permissions([
# 'AppTrackingTransparency',
# 'Bluetooth',
# 'Calendars',
# 'CalendarsWriteOnly',
'Camera',
# 'Contacts',
# 'FaceID',
'LocationAccuracy',
'LocationAlways',
'LocationWhenInUse',
'MediaLibrary',
'Microphone',
# 'Motion',
'Notifications',
'PhotoLibrary',
'PhotoLibraryAddOnly',
'Reminders',
'Siri',
# 'SpeechRecognition',
'StoreKit'
])
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
permissions_path = '../node_modules/react-native-permissions/ios'
notifee_path = '../../node_modules/@notifee/react-native/RNNotifeeCore.podspec'
target 'MyProj' do
config = use_native_modules!
puts "React Native Path: #{config[:reactNativePath]}"
puts "App Path: #{Pod::Config.instance.installation_root}/.."
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
pod 'GoogleUtilities', :modular_headers => true;
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase/Messaging', :modular_headers => true;
pod 'Firebase/Analytics', :modular_headers => true;
pod 'VitalCore'
pod 'VitalDevices'
pod 'VitalHealthKit'
pod 'SendBirdSDK', :modular_headers => true
pod 'SendBirdUIKit', :modular_headers => true
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
pod 'RNNotifeeCore', :path => notifee_path
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#use_flipper!()
target 'MyProjTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end