Rohail
Rohail

Reputation: 11

react-native-qrcode-scanner not working on IOS

I implemented react-native-qrcode-scanner working fine on Android. but problem on iOS. "react-native": "0.73.6", "react-native-qrcode-scanner": "^1.5.5", "react-native-permissions": "^4.1.5",

my podFile is

permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"

also I tried

permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

but getting errors. [enter image description here](https://i.sstatic.net/ORMFf318.png)

please give me the solution to how I can react-native-qrcode-scanner on IOS.

Upvotes: 0

Views: 297

Answers (1)

Madhuri kulkarni
Madhuri kulkarni

Reputation: 95

Do you have this in your Podfile ? with rn >=0.72 the setup is different.

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

node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

platform :ios, min_ios_version_supported
prepare_react_native_project!

setup_permissions([
  'Camera',
])

Upvotes: 1

Related Questions