How to build .IPA file for testing in react-native? - react-native

I have build a project in react-native, for now I am testing the android app by using Expo Client App. I am using Visual Code in Ubuntu 18.04.
So the problem is, now I want to test the project for IOS, but unfortunately i can't test the app, because I don't have MAC OS.
Can anyone tell me the alternative solution of testing react-native project on IOS?
And if somehow there is a solution of creating IPA,then can I use that IPA in IOS without uploading it in AppStore?

You can use snack :
Snack lets you run complete react native project in a web browser,you can set it up on your local machine directly use it from snack.io which also let's you test for android and ios as well

Related

Can I use the same codebase for both a React Native macOS app and a React Native Windows app?

I am trying to create an app using React Native that runs on iOS, Android, macOS and Windows. An advantage of being able to use React Native is that you can share code between platforms.
I am following the setup guides for React Native macOS and Windows, but in the guides, they guide you through creating a new app from scratch for each platform. As I want to use the same app, so I don't have to write the same code twice, I create the macOS app following the guide. Then, in this app, I use the command npx react-native-windows-init --overwrite from the Windows guide to initialise the Windows platform. But when I then go to run the macOS app using the command npx react-native run-macos, I get the error:
Cannot find module 'metro-config/src/defaults/exclusionList'
and
no bundle URL present
One thing I find strange about the setup guides is that for macOS it tells you to use React Native 0.63 and for Windows 0.66. I used 0.66 for both, maybe this is the problem. But if it is, and each platform requires different versions of React Native, how can I use the one app / codebase for both platforms? This goes against one of React Native's core premises:
Create platform-specific versions of components so a single codebase can share code across platforms.
Is it possible to create a single app for both desktop platforms like you would with iOS and Android, and if so, how?
Yes, you can. You will have to create a mono repo
Or you can use mono repo boilerplate. Here is a link to it
https://github.com/mmazzarolo/react-native-universal-monorepo

React Native, build for iOS

I have an app made with React Native that is already working on for Android.
I'm working on Debian 10.
For Android I build my app-release.aab file with this command:
bash android/gradlew --project-dir android --project-prop MYAPP_UPLOAD_STORE_FILE=my-key.keystore --project-prop MYAPP_UPLOAD_KEY_ALIAS=my-key --project-prop MYAPP_UPLOAD_STORE_PASSWORD=mypassword --project-prop MYAPP_UPLOAD_KEY_PASSWORD=mypassword clean bundleRelease
I've been creating this bundle for like a year with no problems, but now I have a task that is "now we want the iOS version"
What do I need to create this iOS version? I'm pretty lost, I have never created nothing for iOS, I just have this React Native app that works ok on Android.
I've been reading some mediums, youtube videos, and some questions here in Stackoverflow but they talk about that it's possible to create the app for both Android and iOS but I can't find a source of clear information about what I need for.
Do I need a Mac?
How should I create the bundle for iOS?
First, if you want to publish to the iOS app store, you need to buy a paid Apple Developer Program, regardless if you have a Mac or not.
Okay, if you have a Mac there is a good amount of documentation: https://reactnative.dev/docs/next/publishing-to-app-store and more. The below is if you do not have a Mac, or do not want to develop on it.
No Mac
You cannot build macOS apps locally without a Mac.
That being said, you could look at CI/CD, for example, Github Actions or Travis CI, as running macOS on them is possible. If you are already pushing your code to Github, I recommend Github Actions. If you do not want to use CI/CD, you can use Expo. With Expo, you can build your app on their servers, and all you need is a paid Apple Developer Program (no Mac).
With vanilla react-native for local development/builds you will need a Mac as Xcode (free) is required for iOS builds. It's propriety software to macOS. You will also need an Apple Developer account to setup development/distribution certificates for deployments.
You can then use Xcode and the iOS certificates/provisions to generate a bundle for iOS.

Why is that we cannot install native libraries on Expo? (that requires linking)

I am a newbie and learned react-native expo. I am curious why we can't use any native library with Expo.
For example, if I want to use filesystem on expo I just cant use it, I know expo has it's own file system but I want to use another library but that library requires linking so it is not working in expo. Why is that?
I have tried everything.
This is the library that I want to use ==> https://github.com/itinance/react-native-fs
It requires command : react-native link react-native-fs
How do I do it?
You first have to understand the difference between react-native cli & expo
Please read this documentation to understand the difference
React Native expo uses their own servers to compile your javascript into java and return APK file as a complete APP, and that is the reason you do not need android SDKs or android studio environment on your PC when you are using expo
but when you are using react-native cli you do need the android studio environment such as SDKs, because when you are using cli , it compiles the code using that android studio sdk/environment that you made in your PC that is why you do not need a third party server like expo do.
and thats the reason you get android files right in your react-native project and due to which you can add native modules to it.
However you also have the option to use expo-eject, You can read more about expo-eject in this documentation
Thank You!, Have a great day & welcome to stackoverflow community!.

Expo - Build in local

I have a question and I didn't find a clear answer.
It's possible to build android and iOS app in local ?
We can build the application with expo build:android and expo build:ios but these commands need an account and send the source code in server of expo.
I see it's possible to eject the app and folder android and iOS are created but after that I keep the possibility to develop with expo ? If I modify a javascript code I can recreate again the android and iOS folder ? or I need to develop in native code ?
Thank you for your answers !
As far as I understand your question, If you eject the app, you can't develop with expo. But, you can keep editing in javascript. There is no necessity to develop in native code.

React-Native-Camera can't compile to android emulator

I am busy trying to implement camera functionality into an app I am writing in react-native. I have installed react-native-camera via npm and have this working solidly in IOS.
When I try and run on android, the project does not build and throws below error
node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/events/BarCodeReadEvent.java:27: error: no suitable method found for init(int)
I have specified the correct android sdk build tools as described on https://github.com/react-native-community/react-native-camera.
I can run simple projects on my android emulator but as soon as I link the react-native-camera, I am unable to build. Does anyone have any ideas, or experience with this?
I am developing on a mac and as mentioned above. Everything works perfectly on the IOS app.