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

[Feature Request] Support for Sharing Web URL Source Along with Selected Text in Safari #116

Open
orlan-spaceduck opened this issue Sep 23, 2024 · 2 comments
Labels
enhancement New feature or request ios

Comments

@orlan-spaceduck
Copy link

Current Behavior:

  • The share extension allows users to select and share text from Safari, but the shared content only includes the selected text.
  • There doesn't seem to be a way to attach the URL of the page from which the text was selected.

Desired Behavior:

  • When users select text in Safari and share it through my React Native app using this library, I would like to have the ability to include the URL of the webpage where the text was selected.
  • This would help provide more context to the shared text, making it easier for the app to offer better user experiences (e.g., showing the original source of the text).

Example Use Case:

  1. User opens a Safari page.
  2. User selects text and clicks "Share."
  3. The React Native app receives both the selected text and the webpage URL as part of the shared content.
  4. The app can now use the webpage URL for further actions (e.g., showing a link preview).
    image

Questions:

  • Is it technically feasible to implement this feature in the current share extension implementation?
  • If possible, can you provide some guidance or point me to the relevant areas in the codebase that might need modifications?
@achorein
Copy link
Owner

that would be great indeed, not sure it's possible, have to check.

We currently retrieve the text from the custom view here:

private func handleText(content: NSExtensionItem, attachment: NSItemProvider, index: Int) async {

@achorein achorein added enhancement New feature or request ios labels Sep 23, 2024
@achorein
Copy link
Owner

@achorein achorein changed the title Feature Request: Support for Sharing Web URL Source Along with Selected Text in Safari [Feature Request] Support for Sharing Web URL Source Along with Selected Text in Safari Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ios
Projects
None yet
Development

No branches or pull requests

2 participants