Git Product home page Git Product logo

Comments (5)

zoontek avatar zoontek commented on May 24, 2024 1

In this case, it will work after a pod install and a cache clean.

from react-native-permissions.

zoontek avatar zoontek commented on May 24, 2024

@imanshul You cleared the Xcode cache, just in case? (DerivedData)

from react-native-permissions.

imanshul avatar imanshul commented on May 24, 2024

yeah removing derived data solved the problem, but the package was installed earlier, and i just enable the permission and did pod install. so do i have to do it everytime I enable or disable any permission?

from react-native-permissions.

zoontek avatar zoontek commented on May 24, 2024

@imanshul Not if you follow the setup in the README

from react-native-permissions.

imanshul avatar imanshul commented on May 24, 2024

All of the steps are followed by podfile is:

# Resolve react_native_pods.rb with node to allow for hoisting
# ----- Uncomment below code, if removing the react-naitve-permissions ----
# require Pod::Executable.execute_command('node', ['-p',
#   'require.resolve(
#     "react-native/scripts/react_native_pods.rb",
#     {paths: [process.argv[1]]},
#   )', __dir__]).strip

# ------ Start Used for react-native-permissions --------
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')
# ------ END Used for react-native-permissions --------

platform :ios, min_ios_version_supported
prepare_react_native_project!

# ------ Start Used for react-native-permissions --------
# ⬇️ uncomment wanted permissions
setup_permissions([
   'AppTrackingTransparency',
  # 'Bluetooth',
  # 'Calendars',
  # 'CalendarsWriteOnly',
   'Camera',
  # 'Contacts',
  # 'FaceID',
  # 'LocationAccuracy',
  # 'LocationAlways',
  # 'LocationWhenInUse',
  # 'MediaLibrary',
  # 'Microphone',
  # 'Motion',
   'Notifications',
   'PhotoLibrary',
  # 'PhotoLibraryAddOnly',
  # 'Reminders',
  # 'Siri',
  # 'SpeechRecognition',
  # 'StoreKit',
])

# ------ END Used for react-native-permissions --------

# 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.disabled

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

target 'App13Karat' do
  pod 'WebEngage'
  config = use_native_modules!

  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

  use_react_native!(
    :path => config[:reactNativePath],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'App13KaratTests' do
    inherit! :complete
    # Pods for testing
  end

  # ServiceExtension Target
  target 'NotificationService' do
      platform :ios, min_ios_version_supported
      pod 'WebEngageBannerPush'
  end

  # ContentExtension Target
  target 'NotificationViewController' do
    platform :ios, min_ios_version_supported
    pod 'WebEngageAppEx/ContentExtension'
  end

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    workAroundForSharedApplication(installer)
  end
end

# Fix for MMKV after adding WebEngage, especially NotificationService and NotificationViewController as App Extension
def workAroundForSharedApplication(installer)
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
        end
    end
end

from react-native-permissions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.