Build using Mac Catalyst¶
On this page
Version 10.6.0 and above of the MongoDB Realm React Native SDK supports Mac Catalyst.
Version 0.65 and above of React Native do not require these additional steps to build using Mac Catalyst.
Update Your Build Phase Settings¶
Before you can use Mac Catalyst in your React Native application, you must specify the platform name. Click Build Phases in XCode, and within the Bundle React Native code and images tab, add the following to specify "ios" as the platform name.
Update Your Podfile¶
This is a temporary step that will not be necessary when the following Cocoapods issue is solved: [Catalyst] Podspec Resource Bundle requires a development team
Currently, there is a Cocoapods bug that causes XCode to require a development team when building for Mac Catalyst. This bug prevents signing locally. As a workaround, you can alter your Podfile to fix your bundle target's signing certificate to sign to run locally.
Replace the post-install script in your Podfile by removing the following lines:
post_install do |installer| react_native_post_install(installer) end
And copy the following lines where your previous post-install script was:
post_install do |installer| react_native_post_install(installer) installer.pods_project.targets.each do |target| # Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally' if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" target.build_configurations.each do |config| config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = '-' end end end end
Activate and Test Catalyst in Your Project¶
To test out Catalyst in your project, activate Mac in the general tab of your XCode project workspace. To do this, click Mac in the Deployment Info section. Select "Scale Interface to Match iPad". This makes "My Mac" selectable, allowing you to run your application on your Mac.