No such module 'OneSignal'

if you have already pod file before starting development OneSignal, you need to add new target for OneSignalNotificationServiceExtension.

    target 'OneSignalNotificationServiceExtension' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for OneSignalNotificationServiceExtension
  pod 'OneSignal', '>= 2.5.2', '< 3.0'

  end

After the adding above code to the podfile. You must "pod install" one again.


Pods written in Swift can be imported with the use_frameworks!, and CocoaPods will complain if you don't do this and try to import the pods in Swift code.

Although any pods not written in Swift, will require the use of a bridging header.

Referencing to the OneSignal pod, the getting-started guide instructs applications using Swift to include a bridging header in order to use the pod. OneSignal: Getting Started Guide


Another thing to mention is that Getting error "No such module" using Xcode, but the framework is there

If the framework header is already included in the bridging header file then you don't have to import it in the Swift source file.


You need to type these commands. It has fixed it for me:

$ pod deintegrate
$ pod install

My Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Your_Project_Name' do
  # Comment the next line if you don't want to use dynamic frameworks

  # Pods for Das Gedenken
pod 'OneSignal'


end

target 'OneSignalNotificationServiceExtension' do
  #only copy below line
  pod 'OneSignal'
end