2

I tried to follow the instruction on here: https://gist.github.com/boopathi/27d21956fefcb5b168fe

The instruction is somewhat dated with respect to how fast new react-native builds are pushed.

I fixed some of the obvious issues in the instruction (change lib.ReactKit.a to libReact.a, etc...).

I was able to compile the swift project and bring up the simulator. However, the red screen of death showed up with the following msg: Unable to execute JS call: __fbBatchedBridge is undefined

Any insights or general direction to how to create a swift project with react-native would be appreciated.

1

1 Answer 1

1

After looking through multiple ways of creating a swift project, the following method worked for me:

1) Follow the instruction here (use the swift version): https://github.com/davidyaha/react-native/blob/master/docs/EmbeddedAppIOS.md

2) If your build ran into a red screen of death with "Could not connect to development server". Paste the following lines into your Info.plist file under your swift project:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>localhost</key>
        <dict>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

Detailed discussion of the reasoning is here https://github.com/facebook/react-native/issues/304

The above steps will allow you to see the react-native component in a swift project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.