DEV Community

Subham Kumar
Subham Kumar

Posted on

How to Update a React Native App Without Play Store (Using Google Drive + JSON)

Publishing an Android app on the Play Store takes time.
But what if you want to share your app immediately with your users and still push updates easily?

Good news:
You can build your own mini update system without any server — just using:

  • Google Drive
  • One JSON file
  • One APK file
  • A few lines of React Native code

In this article i will explains the whole process step-by-step in a clean, simple way.

Why Do We Need This?

When you distribute your app as an APK (e.g., via Google Drive, WhatsApp, Telegram), users will install it once.

But what happens when you release a new version?

They don’t automatically know.

So we create a small, smart system where:

  1. You upload a new APK to Google Drive
  2. You update a JSON file on Google Drive
  3. Your app checks the JSON every time it opens
  4. If a new version is available → show update popup
  5. User downloads & installs the latest APK

This feels like a real update system — but without servers or Play Store.

How the System Works

Think of your app as a student.
Think of your JSON file as the teacher.

Every time the app opens, it asks:

Teacher, what’s the latest version?
The JSON replies:

{
  "latestVersion": "1.0.5",
  "downloadUrl": "YOUR_APK_LINK"
}
Enter fullscreen mode Exit fullscreen mode

Your app compares:

  • Installed version (e.g., 1.0.0)
  • Latest version from JSON (e.g., 1.0.5)
  • If JSON version is higher → app shows an Update alert.

That’s it!

Step 1 — Create a JSON File on Google Drive

Make a file: update.json

{
  "latestVersion": "1.0.5",
  "changelog": "• Faster performance\n• Bug fixes\n• Small UI changes",
  "downloadUrl": "https://drive.google.com/uc?export=download&id=APK_FILE_ID",
  "forceUpdate": false
}

Enter fullscreen mode Exit fullscreen mode

Upload to Google Drive → Right-click → Share →
Anyone with link → Viewer

Now convert the Drive URL:
Example Drive link:
https://drive.google.com/file/d/1abcXYZ/view?usp=sharing

Direct JSON link:
https://drive.google.com/uc?export=download&id=1abcXYZ

Save this — your app will fetch this URL.

Step 2 — Update Version in Your React Native App

Go to:
android/app/build.gradle

Update:

versionCode 2
versionName "1.0.1"

Enter fullscreen mode Exit fullscreen mode

Always increase versionCode before building a new APK.

Step 3 — React Native Code to Check for Updates

Use this code in App.js or your root screen:

import { Alert, Linking } from "react-native";
import DeviceInfo from "react-native-device-info";
import { useEffect } from "react";

const CHECK_URL = "https://drive.google.com/uc?export=download&id=YOUR_JSON_ID";

export default function App() {

  useEffect(() => {
    checkForUpdate();
  }, []);

  async function checkForUpdate() {
    try {
      const response = await fetch(CHECK_URL);
      const data = await response.json();

      const current = DeviceInfo.getVersion();
      const latest = data.latestVersion;

      if (isUpdateNeeded(current, latest)) {
        Alert.alert(
          "Update Available",
          data.changelog,
          [
            { text: "Update", onPress: () => Linking.openURL(data.downloadUrl) },
            { text: "Later", style: "cancel" }
          ]
        );
      }
    } catch (err) {
      console.log("Failed to check update:", err);
    }
  }

  function isUpdateNeeded(current, latest) {
    const c = current.split('.').map(Number);
    const l = latest.split('.').map(Number);

    for (let i = 0; i < 3; i++) {
      if ((l[i] || 0) > (c[i] || 0)) return true;
      if ((l[i] || 0) < (c[i] || 0)) return false;
    }
    return false;
  }

  return (
    // Your app UI
  );
}

Enter fullscreen mode Exit fullscreen mode

Step 4 — What Happens When New APK Is Released?

Whenever you upload a new APK:

  1. Upload new APK to Google Drive
  2. Get direct APK link:

https://drive.google.com/uc?export=download&id=APK_ID

**
Update JSON:
**

{
  "latestVersion": "1.0.6",
  "downloadUrl": "NEW_APK_LINK",
  "changelog": "New features added"
}

Enter fullscreen mode Exit fullscreen mode

Once JSON is updated → All users get update popup next time they open the app.

How to Update JSON on Google Drive (Correct Method)

There are two correct ways, and you should pick only ONE:

*METHOD 1: Replace the JSON File (BEST & EASIEST)
*

If you replace the file using Google Drive’s “Manage versions”, then:

The public link stays the same

Your app will always get the newest JSON file

You don’t need to recreate the link ever again

Steps

  1. Go to Google Drive
  2. Right-click your JSON file
  3. Manage versions
  4. Click Upload New Version

Upload the updated JSON file

Done (The link remains same → app fetches updated JSON automatically)

*METHOD 2: Upload New JSON & Update the FILE_ID
*

If you upload a brand-new JSON file instead of replacing:

  1. Google Drive creates a new File ID (ID changes)
  2. Your app will continue reading the OLD JSON
  3. You must update FILE_ID in the app

BTW I never used 2nd method.

Top comments (0)