expo-share-extension: Sharing Link from Specific Applications has Undefined URL

I’m trying to share a link from a thread from ChatGPT for example, and the url is undefined. When printing the props in the ShareExtension component I don’t see url or text defined, so not sure how to derive it. If I share the link to “Messages” app I see the link does exist. Any idea what the ChatGPT iOS application is doing differently when sharing links that other apps do not do? It’s the only application where the share link feature does not work that I’ve found so far.

Props logged:

{"concurrentRoot": false, "rootTag": 31}

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@MaxAst

Just tested it, you need to use the activationRule text when sharing from the YouTube app. This is not a quirk of expo-share-extension, it’s just how some apps share content. It’s similar to e-commerce apps, they often share links via the text activation rule.

So either you do

"activationRules": [
    {
        "type": "text"
    },
]

or you just don’t specify activation rules at all, because expo-share-extension activates types text and url by default for backwards-compatibility reasons

Hmm, I do have this:

[
        "expo-share-extension",
        {
          "activationRules": [
            {
              "type": "text"
            },
            {
              "type": "url",
              "max": 1
            }
          ]
        }
      ],

But in my props I don’t see anything being passed. Is there anything else that could differ?

export default function ShareExtension(props) {
console.log(props) # empty object
  const { url } = props;
  useEffect(() => {
    // Console log doesn't work here unless you comment out openHostApp.
    openHostApp(`embed?url=${encodeURIComponent(url)}`);
  }, []);

  return (
    <View style={{ flex: 1, backgroundColor: "yellow" }}>
      <Text>{url}</Text>
      {/* <Button title="Open Host App" onPress={handleOpenHostApp} /> */}
    </View>
  );
}

Version: “expo-share-extension”: “^2.0.2”,

@anastely still stuck, I believe we’ve RCAd to YouTube sharing a universal link which the package doesn’t support yet. I’m curious if Claude could add support for it quickly

Hey All I’m facing the same issue with the YouTube app in iOS, I got an empty URL value in the share screen, but when I open YouTube from the browser, “Safari, Chrome” and then share the link to my app, it works well…!

i don’t know how we can fix this, did you find any workaround or something?

@MaxAst

will give it a try!