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

(DOCSP-17079): Mac Catalyst Support - React Native #1252

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added source/images/activate-my-mac-xcode-catalyst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions source/includes/steps-mac-catalyst.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
title: Update Your Build Phase Settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make clear, this step should go away in the next React Native release. Here is the relevant PR facebook/react-native#31062

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe we could already cover our bases by saying do this step for RN < v0.65

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍 added some text in a few spots saying that this is for RN v 0.64 and below, and that you don't need it for RN v 0.65 and above.

ref: update-build-phase-settings
content: |
Before you can use Mac Catalyst in your React Native application, you must
specify the platform name. Click :guilabel:`Build Phases` in XCode, and within
the :guilabel:`Bundle React Native code and images` tab, add the following to
specify "ios" as the platform name.

.. code-block:: none

export PLATFORM_NAME=ios
---
title: Update Your Podfile
ref: update-podfile
content: |

.. note::

This is a temporary step that will not be necessary when the following Cocoapods issue is solved:
:github:`[Catalyst] Podspec Resource Bundle requires a development team <CocoaPods/CocoaPods/issues/8891>`

Currently, there is a :github:`Cocoapods bug
<CocoaPods/CocoaPods/issues/8891>` 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:

.. code-block:: none
:caption: /ios/Podfile

post_install do |installer|
react_native_post_install(installer)
end

And copy the following lines where your previous post-install script was:

.. code-block:: none
:caption: /ios/Podfile

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
---
title: Activate and Test Catalyst in Your Project
ref: activate-catalyst
content: |
To test out Catalyst in your project, activate Mac in the :guilabel:`general`
tab of your XCode project workspace. To do this, click :guilabel:`Mac` in the
:guilabel:`Deployment Info` section. Select :guilabel:`"Scale Interface to Match iPad"`.
This makes "My Mac" selectable, allowing you to run your application on your Mac.

.. figure:: /images/activate-my-mac-xcode-catalyst.png
:alt: Activate your Mac in Xcode Project Workspace
1 change: 1 addition & 0 deletions source/sdk/react-native.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MongoDB Realm React Native SDK
Fundamentals </sdk/react-native/fundamentals>
Data Types </sdk/react-native/data-types>
Usage Examples </sdk/react-native/examples>
Integration Guides </sdk/react-native/integrations>
Advanced Guides </sdk/react-native/advanced>

Javascript SDK Reference Manual <https://docs.mongodb.com/realm-sdks/js/latest/>
Expand Down
5 changes: 5 additions & 0 deletions source/sdk/react-native/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ meets the following prerequisites:
"eject" your Expo project to use {+service-short+}. The installation
steps on this page do not use the Expo CLI.

.. note:: Realm JS version 10.6.0 Supports Mac Catalyst

Building your {+service-short+} React Native application requires additional
steps in order to :doc:`build your application when using Mac Catalyst
</sdk/react-native/integrations/mac-catalyst>`.

Installation
------------
Expand Down
13 changes: 13 additions & 0 deletions source/sdk/react-native/integrations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=====================================
Realm Integrations - React Native SDK
=====================================

.. toctree::
:titlesonly:
:hidden:

Build using Mac Catalyst </sdk/react-native/integrations/mac-catalyst>

- :doc:`Build using Mac Catalyst </sdk/react-native/integrations/mac-catalyst>`


32 changes: 32 additions & 0 deletions source/sdk/react-native/integrations/mac-catalyst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. _react-native-mac-catalyst:

========================
Build using Mac Catalyst
========================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Overview
--------

This page details steps for building your {+service+} application when using `Mac Catalyst <https://developer.apple.com/mac-catalyst/>`_.

.. note::

Version 10.6.0 and above of the {+service+} React Native SDK supports Mac Catalyst.


.. seealso::

:ref:`react-native-install`

Procedure
---------

.. include:: /includes/steps/mac-catalyst.rst