Skip to content

Conversation

@romainlq
Copy link

Problem

When using the preview action with qr-target: dev-build, the generated QR code uses the project's slug instead of the custom scheme defined in app.config.ts.

This causes issues when multiple app variants (dev, staging, production) share the same slug but have different scheme values — a common setup for teams testing multiple environments on the same device.

Current behavior:
// app.config.ts
{ slug: "myapp", scheme: "myappdev" }
// QR code generates: exp+myapp://expo-development-client/...Expected behavior:
// app.config.ts
{ slug: "myapp", scheme: "myappdev" }
// QR code generates: myappdev://expo-development-client/...## Solution

  • Rename appSlug parameter to appScheme in getUpdateGroupQr() for clarity
  • Pass the actual scheme (with fallback to slug) instead of the slug in getVariables()
  • Apply the same fix to continuous-deploy-fingerprint action

Changes

File Change
src/eas.ts Renamed appSlugappScheme parameter
src/actions/preview.ts Use scheme with slug fallback
src/actions/continuous-deploy-fingerprint.ts Use scheme with slug fallback
src/__tests__/eas.test.ts Updated test parameters
src/__tests__/actions/preview.test.ts Added tests for scheme selection + updated snapshot

Testing

With a project using slug: "froot" and scheme: "frootdev":

QR code scheme
Before fix exp+froot://...
After fix frootdev://...

Unit tests added to verify scheme selection behavior.

New unit tests cover:

  • ✅ Custom scheme is used when defined
  • ✅ Falls back to slug when no scheme is defined
  • ✅ Falls back to slug when scheme array is empty
  • ✅ expo-go target doesn't include appScheme
  • ✅ Single string scheme is supported

The QR code generator was using the project slug instead of the custom
scheme defined in app.config.ts. This caused the QR code to open the
wrong app when multiple variants with the same slug but different
schemes were installed (e.g., dev, staging, production).

Now uses the actual scheme from getSchemesInOrderFromConfig() with
a fallback to slug if no custom scheme is defined.
@romainlq
Copy link
Author

Hi, any update on this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant