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

feat: add meta info (like title) to share intent object on Android #44

Conversation

RobinHeidenis
Copy link
Contributor

@RobinHeidenis RobinHeidenis commented Apr 7, 2024

Summary

When sharing a link on Android, the browser adds the page title to the share intent. This is stored in the Intent.EXTRA_TITLE property. The library currently has no way of accessing this extra information. This PR adds a meta object to the share intent with a title property. This way consumers of the library can access the title property in their code. On iOS the meta object will be empty.

The code has been set up so it's easily extendible. It will be a small change to add another extra property.

Todo

  • Update README.md

Issue

fixes: #38

Copy link
Owner

@achorein achorein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well !
just a few little feedbacks

src/ExpoShareIntentModule.types.ts Show resolved Hide resolved
src/ExpoShareIntentModule.types.ts Outdated Show resolved Hide resolved
example/basic/App.tsx Outdated Show resolved Hide resolved
example/basic/App.tsx Outdated Show resolved Hide resolved
@RobinHeidenis
Copy link
Contributor Author

@achorein I've implemented your changes. Good call on adding to the other example projects, I forgot about that. Anything else we can optimize here?

@achorein
Copy link
Owner

achorein commented Apr 8, 2024

Looks good to me 👍

@achorein achorein changed the base branch from main to meta-title April 9, 2024 17:52
@achorein achorein merged commit 25ad80c into achorein:meta-title Apr 9, 2024
4 checks passed
achorein pushed a commit that referenced this pull request Apr 11, 2024
* feat: add meta info (like title) to share intent object on android

* docs: add meta object documentation to README.md

* refactor: change type to interface and add example meta to example apps
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.

More text when sharing a link?
2 participants