OneSignal's XCFramework SDK
OneSignal support for Mac Catalyst and Apple Silicon Macs using an XCFramework
OneSignal's XCFramework version of the iOS SDK can be used for Mac Catalyst Apps since XCFrameworks allow you to support multiple platforms that use the same architecture. In this case both the iOS Simulator and Mac use the x86_64 architecture.
Cocoapods is currently the only dependency manager that can be used to get the XCFramework SDK.
Install OneSignal's XCFramework using Cocoapods
- Make sure your current Xcode project is closed and in the project root, run
sudo gem install cocoapods
. Note Cocoapods 1.9.3 has had issues with XCFrameworks. If you receive build errors try using Cocoapods 1.10 which is currently in beta. To install the beta version runsudo gem install cocoapods --pre
. - Run
pod init
from the terminal in your project directory. - Open the newly created
Podfile
with your favorite code editor such as Sublime. - Add the OneSignalXCFramework dependency under your project name target as well as
OneSignalNotificationServiceExtension
target like below.
target 'your_project_name' do
pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'
end
target 'OneSignalNotificationServiceExtension' do
pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'
end
- Run the following command in your terminal in your project directory.
pod install --repo-update
- Open the newly created
<project-name>.xcworkspace
file.
Make sure to always open the workspace from now on. You can also do this automatically by running xed .
from the root of your project.
Updated about 2 years ago