Build a cross-platform mobile app using React Native

As part of my developer advocacy efforts at IBM, I often build and share demos to showcase our products and how developers can integrate them into their own applications.

The IBM Developer site provides a wealth of resources for developers with a focus on code, content, and community. And code patterns are our way of providing full solutions to common problems that developers regularly face in their work. These code patterns “leverage multiple technologies to solve issues that our developer advocates have recognized as common use cases across multiple industries.”

I recently finished a new code pattern that shows how to create a cross-platform mobile application using React Native framework.

Cross-platform React Native news app using IBM Watson Discovery

The pattern I built uses Watson Discovery News and React Native to build a cross-platform mobile app that fetches recent news for a specific company. React Native is a JavaScript framework that lets you write mobile apps for iOS and Android. The application uses Watson Discovery News to fetch recent and relevant news articles along with sentiment, keywords, and related concepts. Easily customizable, this demo app provides a convenient starting point to use Watson Discovery in your own React Native applications. Instead of learning Swift, Java, or Kotlin to build native mobile applications, you can quickly create apps using your JavaScript knowledge.

React Native uses the same design as React, letting you compose a rich mobile UI from declarative components. For an excellent overview on React Native and building mobile apps using only JavaScript, take a look at the article Dissecting React Native. If you’re interested in diving deeper into React Native, I highly recommend the Udemy course The Complete React Native and Redux Course by Stephen Grider.

IBM Watson React Native news mobile app architecture diagram

If you’re unfamiliar with the service, IBM Watson Discovery is a cognitive search and content analytics engine for applications to identify patterns, trends, and actionable insights. Using Discovery, developers can extract meta-data from returned content such as concepts, keywords, and sentiment using natural language understanding. Watson Discovery News is an indexed dataset that is pre-enriched with natural language processing (NLP) features such as keywords, entities, semantic roles, sentiment, relations, and category classification. So instead of using two products (Watson Discovery and Natural Language Understanding), a developer can make a single API to get combined results.

It’s easy to get started and try the application, even if you have no JavaScript expertise. Just clone the repo, sign up for a free IBM Cloud account, and then update the Discovery credentials with your own. You can have your own cross-platform mobile news app running in minutes.

You can find the full repo on Github here. If you use this as a starting point for your application, please let me know!

Tom currently works in developer relations for IBM Watson. A serial entrepreneur, he's been the founder of numerous startups including Investify and StatsMix, a Techstars alumni company. Tom lives outside Boulder, Colorado and in his free time he's an avid rock climber, skier, and trail runner.

Sliding Sidebar