1.1 JWT Authentication Setup

For User Authentication

This plugin is necessary for user registration and login authentication. After installing and activating the plugin, you will need to configure a few settings. You can either follow the provided guide or follow the steps outlined below:

You need to edit your .htaccess file by adding two lines of code. To locate the file, go to your Cpanel, navigate to File Manager, then to public_html > your_site directory. Once there, click to edit the .htaccess file, and add the following two lines just below the RewriteEngine On line. Finally, click on “Save Changes” at the top.

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

Now, again you have to edit your wp-config.php file and add two lines of code. You will get the file in the same directory Cpanel > File manager > public_html> your_site> wp-config.php. Now click on edit the file and add the following two lines under the define( ‘WP_DEBUG’, false ); line.

define('JWT_AUTH_SECRET_KEY', 'your-top-secret-key');
define('JWT_AUTH_CORS_ENABLE', true);

After adding these two lines of code, you have to add a top-secret key in the first line of the following code. To get the code go to this url and copy the NONCE SALT key and paste it here. After this, your lines will look like in the picture below:

1. Install Plugins

Install and activate the plugins

You need to install certain essential WordPress plugins for the app. To do so, go to your WordPress dashboard, navigate to the Plugins section, and search for the required plugins. Additionally, you must install the “Extend WP JSON API” plugin from the plugin dashboard. Once installed, be sure to activate them.

  1. JWT Authentication for WP REST API (Required)
  2. Secure Custom Fields (Required)
  3. WP REST Cache (Optional but recommended for speed up the data loading time)

Getting Started

Welcome to the Top Stories Configuration Document. You can configure your WordPress site and the app (Android & iOS) by following this doc.

You can choose any WordPress news/blog theme. The app has no relation to the theme as the app will fetch the data automatically via WP REST API.

  • Before starting the configuration, Please make sure that your WordPress website is up and running.
  • Follow the WORDPRESS SETUP first and then follow the APP SETUP.

Introduction

Top Stories is a powerful native mobile app built with Flutter, designed to enhance your WordPress website, whether it’s a blog, news site, or more. This app seamlessly transforms your WordPress website into a fully functional native mobile app for both iOS and Android, complete with customized content. Users can easily add posts from the WordPress admin panel or pull news directly from RSS feeds across various websites.

In addition, Top Stories offers the unique ability to fetch YouTube Shorts from URLs, similar to RSS feeds, saving you time by automatically crawling YouTube video links—no need to enter them manually.

Top Stories efficiently transfers all your content, including various formats from your WordPress website, into your mobile app. To connect with your audience on mobile, a dedicated app is essential. Top Stories takes your customer engagement to new heights with an intuitive UX flow, sleek UI design, and rich functionality across both Android and iOS. Elevate your online business to the next level with Top Stories.