Smart App Link
All posts

Expo App Store and Google Play link generator: get both store links from app.json

, 4 min read

You've shipped your Expo app with eas submit. Now you need the links: one for the App Store, one for Google Play, and ideally one link that works on both. Neither link appears anywhere in your Expo project, so most people end up digging through App Store Connect and Play Console.

You don't have to. Both links can be generated from fields that are already in your app.json.

Where each store link comes from

StoreLink formatBuilt from
Google Playhttps://play.google.com/store/apps/details?id=<package>expo.android.package
App Storehttps://apps.apple.com/app/id<number>The numeric Apple ID, which isn't in app.json

The Google Play link is just your package name. The App Store link uses a number Apple assigns when you create the app in App Store Connect, so ios.bundleIdentifier alone isn't enough. But Apple's public iTunes Lookup API turns a bundle ID into that number:

curl -s "https://itunes.apple.com/lookup?bundleId=com.babar342.Dexwirenews" | grep -o '"trackId":[0-9]*'
"trackId":6480420505

That gives https://apps.apple.com/app/id6480420505.

Want the short way?

Smart App Link gives you one link that opens the App Store on iPhone and Google Play on Android. Free, no card.

Create free link

The generator script

Save this as scripts/store-links.mjs in your Expo project. It needs Node 18 or newer (for the built-in fetch) and has no dependencies:

// Prints the App Store and Google Play links for an Expo app.
// Usage: node scripts/store-links.mjs [country]   (run from the project root)
import { readFile } from "node:fs/promises";

const country = (process.argv[2] || "us").toLowerCase();
const { expo } = JSON.parse(await readFile("app.json", "utf8"));
const bundleId = expo.ios?.bundleIdentifier;
const pkg = expo.android?.package;

if (bundleId) {
  // Apple's public lookup API: bundle ID -> numeric App Store ID.
  const res = await fetch(`https://itunes.apple.com/lookup?bundleId=${bundleId}&country=${country}`);
  const { results } = await res.json();
  if (results?.length) console.log(`App Store:   https://apps.apple.com/app/id${results[0].trackId}`);
  else console.log(`App Store:   not found for ${bundleId} in the "${country}" store (not live yet, or try another country)`);
}

if (pkg) {
  const url = `https://play.google.com/store/apps/details?id=${pkg}`;
  // Play returns 404 for packages that aren't published (or are in closed testing).
  const res = await fetch(url, { method: "HEAD" });
  console.log(res.ok ? `Google Play: ${url}` : `Google Play: ${pkg} is not live yet (HTTP ${res.status})`);
}

Run it on an app that's live on both stores:

$ node scripts/store-links.mjs
App Store:   https://apps.apple.com/app/id6480420505
Google Play: https://play.google.com/store/apps/details?id=com.babar342.Dexwirenews

And on one that isn't published yet:

$ node scripts/store-links.mjs
App Store:   not found for com.example.notlive in the "us" store (not live yet, or try another country)
Google Play: com.example.notlive is not live yet (HTTP 404)

Add it to package.json so the whole team can run it:

{
  "scripts": {
    "store-links": "node scripts/store-links.mjs"
  }
}

Using app.config.js or app.config.ts?

A dynamic config can't be read with readFile. Ask the Expo CLI for the resolved config instead, by replacing the readFile line with:

import { execSync } from "node:child_process";
const expo = JSON.parse(execSync("npx expo config --type public --json", { encoding: "utf8" }));

npx expo config prints the config without the expo wrapper, so drop the { expo } destructuring.

Gotchas

  • The App Store lookup is per country. If your app isn't sold in the US store, pass your country: node scripts/store-links.mjs gb.
  • New releases take a few hours to show up in the lookup API after Apple approves them.
  • Internal or closed testing on Play returns 404 to the public, so the script reports "not live" until you're in production (or open testing).
  • TestFlight builds aren't on the App Store, so there's no public link until release.

Already know one link? Skip the script

If you have one store link handy, paste it into the Smart App Link form. It reads the App Store ID or Play package from the URL, looks the app up on the other store by name and developer, and fills in the app name, the icon and the second link. It shows you which store it matched, so you can double-check.

From two links to one

Two links are awkward in practice. Instagram gives you one bio link, a QR code can only hold one URL, and your share button doesn't know which phone the recipient has. So the last step is to put both store links behind one link that picks the store by device. (For how this works and how to build your own, see how to share one app link for iOS and Android.)

https://smartapplink.app/r/yourapp
  iPhone / iPad → itms-apps://apps.apple.com/app/id6480420505   (App Store app)
  Android       → market://details?id=com.babar342.Dexwirenews (Play Store app)
  Desktop       → your website, or a page with both badges + a QR code

Then use it everywhere your Expo app needs a download link:

// constants/links.ts
export const APP_LINK = "https://smartapplink.app/r/yourapp";
  • In your in-app share button, with Share.share from react-native. See the Expo share button guide.
  • In expo-router web builds, on the "Get the app" button of your landing page.
  • In your README, store-listing promo text and launch posts.

If your app.json has a scheme, add it to the smart link (Pro): Android users who already have the app open it directly instead of seeing the Play Store page.


Turn your two store links into one. Create a free smart link. Paste either store link and the rest fills itself in. Free for 3 links, no card.