MaxAst / expo-share-extension

Expo config plugin for creating iOS share extensions with a custom view.
MIT License
230 stars 8 forks source link

Is it possible to open the app when sharing without a need for modal? #49

Open Misha327 opened 1 month ago

Misha327 commented 1 month ago

Sorry for posting a non-issue, not sure where to ask.

As per title, is it possible to share a url from safari to the app without having to show a modal first?

This is the example I am currently using, I would like to open host app directly.

port { openHostApp } from "expo-share-extension";
import { Button, Text, View } from "react-native";

// if ShareExtension is your root component, url is available as an initial prop
export default function ShareExtension({ url }: { url: string }) {
  const handleOpenHostApp = () => {
    openHostApp(`create?url=${url}`)
  }

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

Thank you for your work.

MaxAst commented 1 month ago

Hi @Misha327, no unfortunately that's not possible at the moment. I might implement this in the future though, will keep you posted here