The last few years we have seen tremendous growth in the field of application development. In the past, developers built Native applications using Java or Kotlin for Android and Swift or Objective C for iOS. However, since the introduction of hybrid application development, the mobile application market has drastically changed. Studies show that a whopping 74% of the top 50 retail apps on the US App Store are hybrid apps.
Here is a list of some popular apps that are hybrid in nature and have a vast user base:
- Uber Eats
In 2015, Facebook released an open-source cross-platform mobile app development framework known as React Native. Today, it is extensively used by developers, ranging from advanced Android and iOS developers to React newbies as well as those who are just getting started with programming. The framework’s popularity has steadily increased since its original release in 2015.
For developers who want to create once and use everywhere, React Native has emerged as a viable option. React Native promises to deliver on the popularity of React.js, which has already been a developer’s favorite for some time now. It aims to become a go-to framework for developers for creating native apps for iOS and Android platforms.
So, at this juncture we have established that using React Native for app development will be advantageous to us in many ways. Now that we have decided to use the React Native framework, the next decision is whether to use the React Native CLI or Expo CLI for our project and in this blog, I will help you figure out the answer.
To give you a brief overview of both in terms of global ratings, take a look at the image below.
Expo has a lot of advantages, one of which is that it helps developing applications easier and quicker by managing all configuration changes, version conflicts, and certificates. In addition to that, here are some of the other advantages of Expo.
- Easy Configuration and Signatures – All the requirements related to deployment like configuration, signatures, certificates are taken care of by Expo itself. With the use of Expo Go, you can easily preview and debug your application just by scanning the QR code in the actual device while the development is ongoing. You can even deploy your app to the Expo Go account before publishing it to the (Google) play store or (Apple) app store for beta testing.
- OTA Updates – Expo also comes with an Over the Air (OTA) feature if you want to update or fix any critical bug without publishing it and reflecting it on end-users’ devices. This feature allows you to switch something within the live users’ application.
- No need of Specialized Equipment – One of the best aspects of Expo is that it enables you to create cross-platform mobile apps without purchasing specialized equipment. For example, if you want to develop an iOS app and can’t afford a Mac or don’t want to deal with XCode for some reason, you can surely do so.
- Easy App Distribution – You can easily share your app across users by creating an account in the Expo Go App and inviting people. They have to login to their Expo Go account and can easily download the app.
- Deployment – Deploying it to the App store and Play Store is very easy with Expo CLI. Expo allows you to design your app and then send it to one of the Expo servers, which will compile it into .apk and .ipa files and give it back to you. For generating apk file we have to use expo build:android and for ipa expo build:ios.
- No Native Module Support – Expo has some serious limitations that limit its growth. Just to give an example, while developing app with Expo, we can’t look or touch the native code, which can be frustrating for developers who want to create their own native modules and integrate them in their React Native apps.
- File Size – The executable size is large which may hurt the general downloads.
- Firebase Services – Nowadays most of the apps being developed use Firebase Services. However, a lot of Firebase Services are not supported by Expo which creates a challenge for developers.
If you wish to work with native code in Expo, you can eject your project and it will be structured the way it should be when you use the React Native CLI to initialize it. However, I do not encourage this method unless and until you are absolutely sure about ejecting the project because it is an irreversible process and there’s no going back. Once you eject it, you will have to deal with many issues that were introduced during the ejection process. The reason behind this is that not all Expo modules are compatible with React Native by default, and since it’s difficult to integrate native code into an Expo-written app, you won’t be able to use some React Native packages that require you to link the package using the cli. It is also worth noting that Expo doesn’t support a lot of mobile native functionality like Bluetooth interaction.
React Native CLI
React Native CLI generates a core react native project for you, as well as platform specific native iOS and Android projects.
- Native Module – React Native CLI can be a great solution if you want to incorporate native code (written in Java/Kotlin or Swift/Objective-C) into your project or even write your own. React Native’s infrastructure has also improved significantly in the last couple of years, and you can make your app look as native as possible.
- Compatibility With Native Functionality – With React Native, you can now connect with a variety of native mobile features such as the camera, file system, Bluetooth, and much more, thanks to the hard work and dedication of the React Native community.
- Payment Methods – Not all payment types and payment methods are supported by Expo CLI. In addition to this if some payment method requires native side implementation which can easily be done with the help of React Native CLI.
- Need of Specialized Equipment – React Native CLI has certain important constraints that you should be aware of. For example, unlike Expo, you will need the appropriate equipment to build your app into either .apk or .ipa. To release your React Native app for production on both major mobile platforms (iOS and Android), you’ll need to have a MAC, XCode (for iOS) and Android studio (for android).
- Configuration & Signatures – Also, when you’re ready to deploy your React native app to production, you’ll need to deal with all the configuration, signatures, certificates, and other details that were handled behind the scenes with expo.
- App Distribution – For distributing your app for testing on iOS, Test Flight is required, while for Android, there are two options- we can either distribute the app using play console or create an apk and share it manually. The latter, you may note, is rarely used.
So, with that, I can wrap up my comparison between Expo CLI and React Native CLI.
Now, here are a few points that will tilt your decision towards Expo CLI over React Native CLI:
- If you don’t have proper hardware specification for application development
- If you’re planning to develop a simple app that fetches data and displays it to the user
- If you’re new to React Native and don’t want to deal with the configuration and signatures
As opposed to that, here are a few points that will draw you towards React Native CLI over Expo CLI:
- If you are planning on making a slightly complex app
- You want to use Native Modules or components such as Bluetooth etc.
Owing to my experience, I prefer React Native CLI for one of its major factors of providing support to work with Native modules. For e.g., In the past we have encountered a challenge while implementing one of the payment methods for which there was no react native support present, but they supported native iOS and Android. So, we created our own native module and integrated it with our application and overcame this.
This, for me, was an obvious win.
However, I encourage you to do some digging and figure out what fits your needs best. Meanwhile, reach out to us at Nitor Infotech to learn more about our mobility services and read our whitepaper on a mobility engineering backed framework that will accelerate your process of choosing from a plethora of mobile development platforms.