Documentation menu

Deep links setup

Shared links such as https://app.example.com/providers/12 open the app on Android (App Links) and iOS (Universal Links). If the app isn't installed, or the link is opened on a computer, the API serves a preview page with Open in the app and store buttons. Chat apps such as WhatsApp read the same page to show the provider's name, rating and photo.

Links use the same paths as the app's screens, so a shared link, a push notification link and an in-app route are the same thing:

Path Opens
/providers/{id} Provider profile (public preview page)
/services/{id} Providers for a service (public preview page)
/categories/{id} Category
/bookings/{code}, /jobs/{id}, /jobs/{id}/quotes, /chat/{id} Customer screens (sign-in first if needed)
/provider/... Provider mode screens (the app switches mode)

Paths that need an account send a signed-out user to sign in, then on to the link. A path the app doesn't know opens home with a short message.

1. Pick the domain

Use a host name that points at this Laravel server, because it serves the verification files and the preview pages. It can be the API's own host (e.g. api.example.com) or a separate one such as app.example.com pointing at the same server. HTTPS is required.

2. Admin settings

In Admin → Settings → Deep links, fill in:

Field Value
Domain app.example.com (no https://)
Android package name your applicationId, e.g. com.yourcompany.app
Android SHA-256 fingerprints one per line: the App signing key from Play Console → Test and release → App integrity, plus your upload or debug key for test builds
iOS bundle ID / Apple team ID from Apple Developer → Membership
App URL scheme default niceserve; must match the app build (step 3)
Store links Google Play and App Store URLs, shown on the preview pages

The API then serves:

  • https://<domain>/.well-known/assetlinks.json
  • https://<domain>/.well-known/apple-app-site-association (JSON, no extension)

The tab shows a preview of both files after you save. Shared links in the app (the provider profile and service pages have a Share button) use the domain from these settings.

To get a debug key fingerprint: keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android.

3. App build

Android. Set the domain and scheme in mobile/android/local.properties (or as environment variables in CI):

DEEP_LINK_HOST=app.example.com
APP_SCHEME=niceserve

These fill the intent filters in AndroidManifest.xml: an autoVerify App Links filter for the paths above, plus the custom scheme.

iOS.

  1. In Xcode, open the Runner target → Signing & Capabilities → + Capability → Associated Domains, then add applinks:app.example.com.
  2. If you change the scheme, update CFBundleURLSchemes in ios/Runner/Info.plist.

Associated Domains needs a paid Apple Developer team.

4. The custom scheme

niceserve://provider/profile/earnings opens a path through the custom scheme. The first part after :// is the first path segment. It's used where App Links can't be relied on, mainly the page Stripe shows after Connect onboarding: from a browser tab, a link to the same domain would just load in the browser. Pick a scheme unique to your app.

5. Verify

  • Android: use Google's Statement List Generator and Tester with your domain, package and fingerprint. On a device with the app installed:

    adb shell pm verify-app-links --re-verify com.yourcompany.app
    adb shell pm get-app-links com.yourcompany.app        # the domain should say "verified"
    adb shell am start -a android.intent.action.VIEW -d https://app.example.com/providers/1
    
  • iOS: check the file with an AASA validator (for example branch.io's). Apple's CDN caches it, so changes can take a while. Then tap a link in Notes or Messages on a real device. Pasting it into Safari's address bar doesn't open the app.

  • Previews: open https://<domain>/providers/<id> in a browser and check the Open Graph tags, or paste the link into WhatsApp. WhatsApp caches previews per URL.

Without verification (a fresh debug build on an unverified domain), you can still test the in-app handling:

adb shell am start -a android.intent.action.VIEW -d https://app.example.com/providers/1 com.example.niceserve.dev
adb shell am start -a android.intent.action.VIEW -d niceserve://bookings/HS-ABC123

Troubleshooting

Symptom Check
Link opens the browser on Android pm get-app-links shows the domain not verified: wrong fingerprint (Play re-signs with the app signing key), DEEP_LINK_HOST doesn't match, or the domain redirects /.well-known/assetlinks.json
Link opens Safari on iOS Associated Domains capability missing, wrong team ID or bundle ID, or the AASA file is still cached. Long-press the link and choose Open in app once to reset the choice
No preview in WhatsApp The page must be public HTTPS with a valid certificate, and the provider must be approved
"Open in the app" does nothing The app scheme in settings doesn't match the app build