Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QR codes broken when using custom schemes #240

Closed
erickreutz opened this issue Nov 23, 2023 · 4 comments
Closed

QR codes broken when using custom schemes #240

erickreutz opened this issue Nov 23, 2023 · 4 comments

Comments

@erickreutz
Copy link

erickreutz commented Nov 23, 2023

Firstly app.json defines the type of scheme as string | string[] and from what I can tell this action doesn't account for an array.

qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appScheme: config.scheme }),

I've also noticed that QR codes break when using custom schemes that deviate from the default project slug. For example if the scheme in my app.json is myapp-dev and the slug is myapp and the bundleId is com.org.myapp then expo prebuild will add the following schemes to Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    ...
    <array>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>myapp-dev</string>
          <string>com.org.myapp</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>exp+myapp</string>
        </array>
      </dict>
    </array>
    ...
  </dict>
</plist>

You'll then use the custom scheme to get a QR code here

https://qr.expo.dev/eas-update?appScheme=myapp-devprojectId=123&groupId=456

This returns a QR code that the expo-dev-client will not understand because it appends exp+ to all app schemes and exp+myapp-dev is not a known scheme.

You can see an example of this problem at https://expo.dev

image

It says "use appScheme" from app.json but it's not the appScheme it's expecting - it's the project slug because the appScheme (if it's user-defined) won't work with the exp+ prefix.

@byCedric
Copy link
Member

Hi @erickreutz, thanks for reporting this issue! I've just patched support for multiple app schemes, this was added lately and wasn't updated in this action yet. See PR #244 for this.

The other issue, related to the QR code prefixing schemes with exp+, work is on it's way. But, since this is part of our internal services, it's on a private repo.

Will provide an update once I have more!

@byCedric
Copy link
Member

The multi-scheme fix, and an optional "overwrite" app-scheme input property are released on expo/expo-github-action/preview@v8.

The QR code with exp+ prefix will likely take a bit longer because of a US holiday.

@byCedric
Copy link
Member

byCedric commented Dec 2, 2023

Fix has been merged and released as expo/expo-github-action/preview@8. Website fix is a minor textual change, which we don't need to wait for.

@byCedric byCedric closed this as completed Dec 2, 2023
@erickreutz
Copy link
Author

@byCedric thank you!

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

No branches or pull requests

2 participants