Where is Xcode Project in React Native? - ios

I am trying to find my Xcode project file inside React Native so I can setup React Native Firebase (https://rnfirebase.io/docs/v5.x.x/installation/ios)
However, I cannot find where the Xcode project file is? Can anyone help.

You can find Xcode project files here:
yourProjectDir/ios/yourprojectname.xcodeproj
If You use cocoapods then you should always use this file:
yourProjectDir/ios/yourprojectname.xcworkspace

If you use Expo or create react native app you will not have an iOS folder as these are abstracted away from you.
If you wish to use a dependency that requires you to edit native code then you need to eject your application. https://docs.expo.io/versions/latest/expokit/eject
From your command line run expo eject and it will build the necessary ios and android folders for you. However there are several ramifications if you eject your app. You should read the above link carefully.

YourRNProject/ios and there you have it inside!

Open your react native folder
you can see ios folder
this folder is what you search for

Related

How to add a framework to iOS library project?

I have very little experience in native iOS development but my current job is to wrap some specific native iOS framework to use it in React Native.
Preliminary data: common React Native tools generate an empty iOS library project and an example iOS app project that utilizes this library.
First I've tried to add the needed framework directly to the example app using CocoaPods - and it works fine, the framework became a part of linked libPods.a file, then if I add
#import MyTargetFramework;
to AppDelegate.m I can access different methods of the framework from it.
Next I switched to my iOS library project, applied the same setup (created a Podfile, added the same pod MyTargetFramework to it), then added the same #import MyTargetFramework to *.m file - but got a build error:
Module 'MyTargetFramework' not found
Also I've noticed that there is no libPods.a for iOS library project, all the pods are merged to a Pods.framework instead.
So my question is - what am I doing wrong? Why does it work for iOS app project, but not for iOS library project? How can I properly link my target framework to my own iOS library? I've already spent some time googling, but found nothing about app vs lib differences from this point.

Open Expo based react native app with Xcode

here is my question.
I created my react native app with expo. Today I needed to open my project with xcode, but when I tried to open Xcode give me an error that´s not possible to open the folder.
Any know why?

Opened my React Native project in Xcode, where is my code?

I recently had to install a react native module that needed configuring in Xcode, but I've been using Visual Studio (VS) Code for many months now on my project. So I opened the workspace file in the project's 'ios' folder.
I can not find any of my App.js code or src files while in Xcode. How do I continue my project in Xcode? Or do I need to continue using VS Code, and just run the saved files in Xcode/iPhone simulator?
p.s. I am not using Expo
You wont get any code in your xcode project, while running your app on android or ios the App.js or other react-native code is bundled, so to change or view react-native code use another editor like VS-Code or Sublime text
Xcode is for only Apple products, there is no JS(X) syntax support, eslint and etc. so, i highly recommend to continue your RN app development in another IDE/Editor, which supports JS(X) and many other major features that need for RN development.

React native link Ejecting

I tried searching in previous questions, but I did not find it. I made the mistake of using Create React Native App projects. I am trying to do react native link. I did npm i --save. I get an error
react-native link can not be used in Create React Native App projects. If you need to include a library that relies on custom native code, you might have to eject first. See https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md for more information.
I read this and sadly I am completely at a lost. I am using visual studio code and not xcode.
The error is exactly as it states. You cannot link assets and libraries that require linking unless you eject the project from Create React App and get the native project files. Ejecting gives you the native code and with that, you can use Xcode to link libraries with native code.
Create React App is built on Expo, which aims to allow you to develop apps, especially iOS apps, on any platform. But Expo comes with its restrictions due to the very nature of what it accomplishes.
Thus, the problem arises when you want to link platform dependent libraries that require Xcode in iOS's case. Xcode is the proprietary - and really, the only way, to build Apple-based projects that require external libraries because they require APIs and environments only available with it. This was one the huge reasons Expo arose, to allow people to build apps with React Native without having Xcode, but it has its limitations.
So, you cannot use a library that requires linking with native code if you do not have Mac OS because APIs and tools needed for it are only offered on Mac OS.

Creating pod from Unity iOS project

I have created a game with Unity.
I have exported it as a Xcode project.
I want to create a pod from that Xcode project.
My problem is that the exported Unity project has a Native folder that contains way too many files.
When installing my podspec for the Unity project my computer runs out of ram when trying to write up the Pods.xcodeproj.
Has anyone faced a similar problem as this one?
No you can perfectly do that. But in order to achieve what you are asking, you should your game as a view in native ios and then use cocoapods to add extra capabilities to your ios app. In this case your game becomes like a component in your native ios app and you can play with the rest of your app as you wish here is a guide that can help you;
https://github.com/jiulongw/swift-unity
You probably should not do that. Unity creates a XCode project that is not supposed to be versioned or reused in any way. It is just necessary to create a working iOS version of your game and sometimes used for debug proposes but it is an ephemeral thing. If you want to redistribute your game you should do it using the Unity project itself.

Resources