Can we develop a web and mobile application (Android, iOS, web) with single code base by using React Native? - react-native

Can you please help with this.
I am trying to develop mobile and web apps using react native with single code base for web, android and ios. Can we Develop Web and Mobile Application with single code base by using React Native?

The simple answer is yes. However, there are a lot of caveats that you could encounter along the road with certain device requirements and functionality where you may have to write conditional code, but it could still stay in the same codebase.
The easiest way to get started is by using Expo (https://expo.io), which would let you get started with a project that could be run on Android, iOS, and the Web (via React Native Web) all with very minimal setup on your part.

Related

ReCaptcha for React Native Web, Android and iOS

I'm looking for a solution to implement Google ReCaptcha on a React Native application that is also utilizing react native web. We are not using firebase.
So I know how to implement a web version in React and also know how to implement it in React Native for Android and iOS, but I'm in need of a solution that will work seamlessly for all 3 platforms with as minimal conditions as possible... (ie Platform.OS === 'web
', etc)
If anyone has built a solution and is willing to share the approach I would appreciate it.
I am also open to an alternative to ReCaptcha that will prevent robots. I've thought of generating images of math equations and validating the answers server side but I don't really want to reinvent the wheel and would love a drop-in solution that is production ready, if it exists.

Is it possible to integrate a TWA into a React Native project?

I am wondering if it is possible to integrate TWA (Trusted Web Activities) into an existing React Native project. This way I could have a section in my app where costumers can use my PWA inside my app. As fallback for iOS I would use something like their WebView. If it is possible, how would I go about implementing it?
In short, yes, it is possible to integrate Trusted Web Activity into a React Native App.
You'd need to create an Android Native Module that wraps Android Browser Helper into a React Native API. Since you want to use the Trusted Web Activity as part of your app, you will probably be looking into wrapping TwaLauncher.
Then, you will need to implement a module for iOS, which will have the same API in React, but will use the WebView as an implementation.
It seems someone has already created a wrapper for Android (but I haven't tested).

React Native Mobile App also working on Web and Desktop

Does React Native support Web and Desktop targets?
I would like to build the main version of app as mobile.
Would it be possible to compile the same mobile app, maybe with minor modifications for Web and Desktop?
The user experience for the secondary use cases - Web and Desktop doesn't matter much, I need just the app more or less in a working state and it will be enough. Does React Native allows that?
For Web, you can use react-native-web

Do I have to code my site with NativeScript and VueJs for a separate native app or I could just directly convert it to native?

I am new to NativeScript and I just used VueJs since last year only. I already got a working website with admin page and dashboard made with VueJs and Bootstrap for my front-end.
I have read about nativescript these past few weeks and I planned to make my website native.
Should I rewrite my website with admin functions in nativescript or could I just use nativescript to enable my website as native app in android?
Thank you.
If you have coded your app with Vue or Angular and if you choose NativeScript to build your native mobile app, then you will be able to reuse the data model, services, basically anything that is not related to UI.
We call it native mobile app for a reason, your UI is pure native here, more or less equivalent to building a mobile app using Java (Android) / Objective C (iOS). You will have access to all native UI components and device apis, which is why you have to recode your UI.
What you must be looking for is something like Corodova / PhoneGap (Hybrid mobile app) which can just take your web app and wrap it inside a WebView.

Real technical advantages of React Native over Web

I thinking about real technical advantages of creating React Native app over web SPA. I figured out that only 1 advantage could be - it's saving and loading data in phone store. Another things like, for example, access to GPS, camera, etc are also available in JavaScript Web. So, that is real technical advantage of using React Native over Web?
Overall, it really depends on what your application is for...
If your Application will be used by mobile users only, then React Native is a perfect solution. However, if you want an application with a Web presence, so users can use it on Desktops etc - then it wouldn't really be suitable unless you did both a Web SPA and a mobile app.
For example, if I were to create an accounting app - which will be used by users on Mobiles and Desktop, then perhaps I'd consider building a SPA which is mobile friendly or both SPA and an App with an API for both.
If you were building a tracking app, which will only be available for mobile - then go for it.
If your users will be using desktop, then you can build it perhaps in React and when you get to React Native you know the react library!
React Native in itself builds both iOS and Android Apps, so instead of creating a 'hybrid' app (which includes webviews) or a native App in both iOS and Android - you only create one code base and build it to your chosen OS. This saves alot of development time. As the community is open source, alot of upgrades happen and there is alot of help online if you encounter an issue.