-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
IntentAndroid.openChooserWithOptions implements #5476
Conversation
* Open a chooser dialog to send data to other apps. | ||
* | ||
* Refer http://developer.android.com/intl/ko/training/sharing/send.html | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-trailing-spaces: Trailing spaces not allowed.
@deminoth updated the pull request. |
Hey. Thanks a lot for the PR. I've couple of questions and some feedback,
I'll prefer something like,
|
The "withOptions" suffix is an Objective-C idiom, and I agree it's not appropriate for the JS api (we should remove it from ActionsSheetIOS).
|
|
@satya164 they're not exactly singletons, because they can be stacked, but yes I think including more than one as a sibling should probably be an error. |
@janicduplessis has a bit of a knack for componentizing these things, perhaps he'd like to have a go at it :-) |
For something like Another thing that can be used to componentize singleton APIs is something like I did with |
I actually prefer the stacking idea better. We can have multiple components and only have the component at the top of the stack visible. I am not in favor of merging props of different components, because then I can't just look at my component and predict what the state will be, which is a big advantage of React in the first place. |
Merging props makes sense for the statusbar, but not for alerts. For example, you wouldn't want the topmost alert to show the message from the one underneath if you only specified a title! |
More on topic of this PR, That would require a lot of shuffling around the API :( |
@deminoth updated the pull request. |
Thank you for all the discussions. Maybe I can make an universal |
I desperately needed this in a project I am working on, so for the time being I implemented some of your code into a react module that will popup the default android share tray. Will be happy to deprecate when you build ShareModule or something like that. https://github.com/haydenth/react-native-android-share |
Thanks for releasing it @haydenth! Had a quick look:
Looks like you could use some parts of this PR too. |
@deminoth Interested in working on a ShareModule? |
@satya164 I was busy and just started working now. Should I provide an UIExplorer example too? |
@deminoth Yeah, will be great. Thanks. |
A new PR for ShareModule #5904 I want to use this PR but got stuck on Git merging... |
Hey @deminoth! Thanks for making the pull request, but we are closing it due to inactivity (37 days with no activity) to make sure all pull requests are either being worked on or closed. If you want to get your proposed changes merged, please rebase your branch with master and send a new pull request :) |
Summary: revision of #5476 It has only one method `shareTextContent` and next will be`shareBinaryContent`. In Android, Promise can't receive a result, because `startActivityForResult` is not working with `Intent.ACTION_SEND`. Maybe we can use `createChooser(Intent target, CharSequence title, IntentSender sender)` which requires API level 22. Closes #5904 Differential Revision: D3612889 fbshipit-source-id: 0e7aaf34b076a99089cc76bd649e6da067d9a760
Summary: revision of facebook/react-native#5476 It has only one method `shareTextContent` and next will be`shareBinaryContent`. In Android, Promise can't receive a result, because `startActivityForResult` is not working with `Intent.ACTION_SEND`. Maybe we can use `createChooser(Intent target, CharSequence title, IntentSender sender)` which requires API level 22. Closes facebook/react-native#5904 Differential Revision: D3612889 fbshipit-source-id: 0e7aaf34b076a99089cc76bd649e6da067d9a760
do plan to implement image sharing on Android? |
@mikach I don't have enough time for that now. I can help you if you make PR. |
Summary: revision of facebook#5476 It has only one method `shareTextContent` and next will be`shareBinaryContent`. In Android, Promise can't receive a result, because `startActivityForResult` is not working with `Intent.ACTION_SEND`. Maybe we can use `createChooser(Intent target, CharSequence title, IntentSender sender)` which requires API level 22. Closes facebook#5904 Differential Revision: D3612889 fbshipit-source-id: 0e7aaf34b076a99089cc76bd649e6da067d9a760
This implementation of
IntentAndroid.openChooserWithOptions
is similar toActionSheetIOS. showShareActionSheetWithOptions
. It callsIntent.createChooser()
and you can see how it acts at android docs