Swift Package Manager Setup
1. Open your project in Xcode and navigate to the project's settings > Package Dependencies and press the + button.
2. enter Package URL:
3. Set the Dependency Rule to:
Range of Versions and
Click Add Package
4. On the next screen to choose your Package, select the OneSignal Package and Add Package to your main app Target.
Using the Modularized SDK
If you are looking to resolve the warning "Linking against a dylib which is not safe for use in application extensions", please use SDK version 3.11.0+, and make the following package and import changes.
OneSignalfor your Main App Target, and product
OneSignalExtensionfor your Notification Service Extension target.
Then, in your
import OneSignalExtensioninstead of
import OneSignaland change references of
OneSignalin method bodies to
5. Open your Main App Target and under "Frameworks, Libraries, and Embedded Content" ensure that the OneSignal SDK has been added.
6. Next we will link the library to your App's Notification Service Extension (follow the setup guide if you have not created one yet).
OneSignalNotificationServiceExtension Target > Build Settings >
Runpath Search Paths.
The build setting should include the path
@executable_path/../../Frameworks. Add this if you do not see it
Done! Continue with the rest of your setup guide.
Updated 2 months ago