ScaleRocket/Mobile

Deep Linking

Configure URL schemes, universal links, and test deep links in your Expo app.

Deep Linking

ScaleRocket Mobile uses the scalerocket:// URL scheme for OAuth callbacks, email links, and custom navigation.

URL Scheme Configuration

The URL scheme is configured in app.json:

{
  "expo": {
    "scheme": "scalerocket"
  }
}

This allows the app to handle URLs like scalerocket://path/to/screen.

ScaleRocket Mobile uses deep links for:

PurposeURLDescription
OAuth callbackscalerocket://Google/Apple sign-in redirects back to the app
Password resetscalerocket://reset-passwordEmail reset link opens the app
Email confirmationscalerocket://confirmEmail verification link opens the app

Generating Redirect URIs

Use expo-linking to generate redirect URIs for OAuth:

import { makeRedirectUri } from "expo-linking";

const redirectUrl = makeRedirectUri({ scheme: "scalerocket" });
// Returns: scalerocket://

Add this URL to your backend's allowed redirect URLs:

  • Supabase: Authentication > URL Configuration > Redirect URLs
  • Convex: Auth settings > Redirect URLs

Expo Router automatically maps deep link paths to screens. A deep link to scalerocket://settings navigates to app/(tabs)/settings.tsx.

To handle deep links programmatically:

import * as Linking from "expo-linking";
import { useEffect } from "react";

useEffect(() => {
  // Handle deep link when app is already open
  const subscription = Linking.addEventListener("url", ({ url }) => {
    console.log("Deep link received:", url);
    // Parse and navigate
  });

  // Handle deep link that opened the app
  Linking.getInitialURL().then((url) => {
    if (url) {
      console.log("App opened via deep link:", url);
    }
  });

  return () => subscription.remove();
}, []);

For links that work both in the browser and in the app (e.g., https://yourapp.com/invite/abc), configure universal links.

Add the associated domains configuration to app.json:

{
  "expo": {
    "ios": {
      "associatedDomains": ["applinks:yourapp.com"]
    }
  }
}

Host an apple-app-site-association file on your domain:

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "TEAM_ID.com.scalerocket.app",
        "paths": ["/invite/*", "/reset-password/*"]
      }
    ]
  }
}

Add intent filters to app.json:

{
  "expo": {
    "android": {
      "intentFilters": [
        {
          "action": "VIEW",
          "autoVerify": true,
          "data": [
            {
              "scheme": "https",
              "host": "yourapp.com",
              "pathPrefix": "/invite"
            }
          ],
          "category": ["BROWSABLE", "DEFAULT"]
        }
      ]
    }
  }
}

In the Simulator/Emulator

# iOS Simulator
npx uri-scheme open scalerocket://settings --ios

# Android Emulator
npx uri-scheme open scalerocket://settings --android

On a Real Device

# Using Expo CLI
npx expo start --dev-client
# Then open: scalerocket://settings in the device browser

With curl (Expo Go)

# Open the app via Expo's deep link proxy
npx uri-scheme open exp://127.0.0.1:8081/--/settings --ios

Changing the URL Scheme

To use your own URL scheme instead of scalerocket://:

  1. Update scheme in app.json
  2. Update all makeRedirectUri calls
  3. Update your backend's redirect URLs
  4. Rebuild the app (scheme changes require a new build)

On this page