Why we chose React Native for our mobile apps

© Illustrations par Bailey McGinn

In the beginning

Doctolib is primarily a web-based company; it is important to us to be able to publish when we want, for our users to have the latest version of our application, and ideally to use one code across all platforms.

In the beginning Doctolib was far from a household name; our traffic was driven by natural SEO. Users were not yet searching directly for Doctolib in app stores to book their appointments, but rather would use a search engine to look for “dentiste Paris” or “Dr. Zoidberg”. This delivered them to Doctolib, a mobile web page giving them the option to book an appointment online. As an alternative to marketing investment, the mobile website was crucial in order to increase our B2C traffic.

As the company grew so did its reputation as a reliable and valuable service. To further increase our visibility, we published Android and iOS applications during the summer of 2016 on the App Store and Play Store. This way we tapped into the audience of users who are more inclined to download an app rather than find information via a browser. At this time, Cordova was the easiest way for us to encapsulate our web app in a webview.

Today we have more users using our mobile device than those accessing the site on a desktop, and in the medical category on both the App Store and Play Store the Patient app is in first position. Though we never used any form of promotion, almost 17% of patient users now use native apps.

Traffic sharing on www.doctolib.fr for September 2018

So, why we left Cordova

Each new release was an enormous amount of work. Cordova works pretty much like a black box; we don’t understand what’s going on and it is always complicated having an Android studio/Xcode project that builds with the right certificates.

A few months ago, we set the goal of reducing patient SMS reminders by using push notifications in order to reduce our SMS bill. The cost of sending an SMS is 3 cents whereas using a service like Firebase would allow us to send push notifications at zero cost. In order to do this, we needed more access to modify Android Studio/Xcode projects and some native classes, access that Cordova does not provide. Other native API features we plan to incorporate like Touch ID, Face ID etc. would also be difficult to develop using Cordova.

Why not native

At Doctolib, pragmatism reigns. A native approach would involve three times the work (Android, iOS, Web) so as long as we can achieve the same end results we will always opt for the more pragmatic option in order to avoid writing and maintaining overcomplicated code. Additionally writing native code requires a knowledge of Android and iOS specific platforms and their respective languages (Java or Kotlin for Android, Objective C or Swift for iOS). Our developers would have to develop these native skills. At Doctolib we love the idea of full stack developers, so this point is important.

Why we chose React Native

At Doctolib, our front-end developers for both patient and doctors extensively use React. Our patient mobile web app is almost entirely built with React. It is easier for our developers to write code in React Native because React and React Native use the same principles and language.

Down the road we will even be able to share code between the web and the native apps. For instance, if we want to create an offline screen on mobile apps that display the patient’s upcoming appointments we can use the same code for its UI and behaviors. This code could be shared between web and native with the exception of the final UI component (<div/> for web vs. <View /> for native). You can read more about this topic another medium article or just scroll through some of other articles.

Moreover, React Native dev tooling is pretty amazing; the option to have hot reloading on native components is incredible and very effective.

Different strokes for different folks

In late June Airbnb published five articles explaining why the company is returning to native development after a period of two years using React Native. Their decision has not impacted our own choices; React Native is still used by many big apps and backed by Facebook. Its community is bigger and more active than that of Cordova but above all, Doctolib is not Airbnb. Unlike Airbnb, only two of our developers, myself included, have experience developing native mobile applications and our application is mainly a webview. React Native may not be the perfect choice for all companies, but it is certainly the best and most pragmatic choice for us at this time.