Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OneSignalExtension No such module #1728

Open
2 of 3 tasks
phuvinhng opened this issue Aug 9, 2024 · 10 comments
Open
2 of 3 tasks

[Bug]: OneSignalExtension No such module #1728

phuvinhng opened this issue Aug 9, 2024 · 10 comments

Comments

@phuvinhng
Copy link

phuvinhng commented Aug 9, 2024

What happened?

In project react native, I have installed OneSignalExtension. However, OneSignalExtension not found in file NotificationService

Steps to reproduce?

1. rm -rf Pods
2. rm -rf Podfile.lock
3. Clean project
4. rm -rf build folder ios

What did you expect to happen?

I expect app running

React Native OneSignal SDK version

5.2.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@phuvinhng
Copy link
Author

Screenshot 2024-08-09 at 08 56 28

@phithu
Copy link

phithu commented Aug 14, 2024

+1

2 similar comments
@feliper-botelho
Copy link

+1

@anasvemmully
Copy link

+1

@nan-li
Copy link
Contributor

nan-li commented Aug 15, 2024

Hi, can you share what you have in your Podfile?

@matheusleite
Copy link

+1

3 similar comments
@ChoiHyeongu
Copy link

+1

@andrzli
Copy link

andrzli commented Sep 17, 2024

+1

@davide-granello
Copy link

+1

@Rohit-vinfotech
Copy link

Rohit-vinfotech commented Oct 20, 2024

HELLO ALL

I have resolved this by updating pod file
please update your Main target name

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native-permissions/scripts/setup'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

production = ENV["PRODUCTION"] == "1"

target 'your_main_target' do
  config = use_native_modules!
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  setup_permissions([
    'Camera',
    'LocationWhenInUse',
    'MediaLibrary',
    'Notifications',
    'PhotoLibrary',
    'PhotoLibraryAddOnly',
  ])
end

# OneSignal Notification Service Extension target
target 'OneSignalNotificationServiceExtension' do
  use_frameworks! :linkage => :static
  pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end

# Combined post_install hook for both targets
post_install do |installer|
  # For DigilegalPro and general post install tasks
  react_native_post_install(installer)
  __apply_Xcode_12_5_M1_post_install_workaround(installer)

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
      
      # This setting is required for app extensions
      if target.name == 'OneSignalNotificationServiceExtension'
        config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
      end
    end
  end

  # Xcode 14 resource bundle signing fix
  installer.target_installation_results.pod_target_installation_results
  .each do |pod_name, target_installation_result|
    target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
      resource_bundle_target.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants