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

fix: missing scheme on runtime when using expo-updates #48

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

achorein
Copy link
Owner

@achorein achorein commented Apr 9, 2024

Summary

When using expo-updates in a release build, sometimes the scheme is no availaible in the runtime (Constants.expoConfig?.scheme)

similar issue : https://github.com/expo/custom-expo-updates-server/issues/12

Todo

  • fallback to Linking.createUrl if missing
  • Provide a option to force scheme value
    useShareIntent({
      scheme: "exposhareintentexample",
    });
    <ShareIntentProvider
      options={{
          scheme: "exposhareintentexample",
      }}
    >
  • Update react-navigation demo to replace Constants.expoConfig?.scheme in custom linking configuration
  • Update README.md

Issue

Fixes #46

Testing

https://docs.expo.dev/eas-update/debug-advanced/#ios-local-builds

yarn ios ---configuration Release

@felixaa
Copy link

felixaa commented Apr 9, 2024

Awesome job, and great find! I guess another possibility could be to include the app scheme in the plugin config 🤔 . But I think your suggestion putting it in the config options makes sense

        [
            'expo-share-intent',
            {
                iosAppScheme: 'myAwesomeApp'
                iosActivationRules: { ... },
                androidIntentFilters: [ ... ],
            },
        ],

@achorein
Copy link
Owner Author

achorein commented Apr 10, 2024

Indeed, we should be able to get the scheme from the app config.

The plugin already have the scheme but it run on the prebuild phase and only manage native code and generation for build.

Need to find a solution for the runtime without adding a boller plate in the native code.

I will try to use the Linking.createUrl() API

@achorein achorein changed the base branch from main to release-candidate April 10, 2024 17:43
@achorein achorein force-pushed the fix/missing-scheme-on-runtime branch from c3d07f1 to de39c60 Compare April 10, 2024 17:44
@achorein achorein merged commit 65c7d66 into release-candidate Apr 10, 2024
4 checks passed
@achorein achorein deleted the fix/missing-scheme-on-runtime branch April 10, 2024 17:46
achorein added a commit that referenced this pull request Apr 11, 2024
* fix: missing scheme on runtime when using expo-updates

* bump example deps

* add utils to compute scheme from expo-linking when missing
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.

2 participants