Build a cross-platform mobile app using React Native


This developer code pattern uses Watson Discovery News and React Native to build a cross-platform mobile app that fetches news for a specific company.


While there have been numerous attempts at effective cross-platform mobile development over the years, none have really met expectations and become popular among programmers until React Native. React Native is a JavaScript framework that lets you write mobile apps for iOS and Android. Originally created and then open-sourced by Facebook, the company still actively participates and updates the platform.

This code pattern illustrates how to create a cross-platform (iOS and Android) mobile app that fetches news for a specific company. The application uses Watson Discovery News to get news articles with sentiment, keywords, and related concepts. This application is easily customizable and provides a starting point to use Watson Discovery in your own React Native applications. Instead of learning Swift, Java™ programming, or Kotlin to build native mobile applications, you can now rapidly build mobile applications using JavaScript.

This code pattern provides an introduction to using React Native as well as Watson Discovery. The pattern details a mobile application that is built using JavaScript and React Native to fetch recent news articles for a specific company using Watson Discovery News. Each news article returned is displayed in a card within a list view. Clicking the article provides more in-depth analysis from Watson Discovery including keywords, related concepts, and sentiment.


Flow for build cross-platform app

  1. Watson News data is loaded into the Watson Discovery service collection.
  2. The user interacts with the Watson Discovery service through the React Native mobile app UI running in the Xcode iOS Simulator.
  3. The initial load of the mobile app pulls recent, relevant articles for a company. The user can then click insights to get sentiment, keywords, and concepts from Watson Discovery for any specific article.


Find the detailed steps for this pattern in the readme file. The steps show you how to:

  1. Clone the repo.
  2. Create IBM Cloud services.
  3. Configure the credentials.
  4. Run the application.