wkh237 / react-native-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.61k stars 1.57k forks source link

Implement ShareSheet behaviour on Android #357

Open RUIFERNANDE5 opened 7 years ago

RUIFERNANDE5 commented 7 years ago

The iOS one is amazing!

wkh237 commented 7 years ago

@RUIFERNANDE5 , I think ActionViewIntent might fulfill your need.

RUIFERNANDE5 commented 7 years ago

I mean, doesn't the actionViewIntent opens automatically the file based on mime type? I want the share sheet like iOS

RUIFERNANDE5 commented 7 years ago

Update: I actually found that it is in fact the expected behaviour on android, even if openDocument on iOS is not intended to use as a shareSheet , it works. But not on Android, not sure if there is a current method to do that on Android atm?

@wkh237 sorry for the insistence, any current solution for this? Thank you

wkh237 commented 7 years ago

@RUIFERNANDE5 , from my understanding, Android does not have a built-in file opener like iOS. After some investigations, I think this one looks promising. However, I'm wondering if it's a good idea to integrate a large module into this library.

If this is an urgent case to you, I'd suggest making an adapter for aFileChooser by following the guidance in official document 👍

RUIFERNANDE5 commented 7 years ago

@wkh237 sure, I can try I just don't know if aFileChooser is the best library since it has a bunch of issues, pr's and it was not updated for 3+ years. I don't really know java, if I can't deal with creating the adapter but I do find any better library to integrate with react-native-fetch-blob i'll make sure to post it there in case someone wants to help! Thank you

wkh237 commented 7 years ago

@RUIFERNANDE5 , please feel free to share your findings. We can still make an experiment in development branch 👍

RUIFERNANDE5 commented 7 years ago

@wkh237 I was analyzing the library u sent, and I don't know if u really understood what i wanted. So i'll just post a screenshot so you, or anyone who comes around understands better.

Resumé: I've generated a .vcf file and saved it on DocumentDirectoryPath folder, now, I need to be able to share this file to any supported app for this mime type (contacts app, email, save to device, etc).

iOS current (and correct) behaviour:

screen shot 2017-05-15 at 14 52 20

Anyway, sorry for the spam and you do not have to answers this question. Just in case you didn't get it or anyone else doesn't.

wkh237 commented 7 years ago

@RUIFERNANDE5 , have you tried react-native-share ?

RUIFERNANDE5 commented 7 years ago

@wkh237 yes I have and it is what I'm using for android. How hard would it be to implement the following? I think its the system native share box, at least all system apps do that.

img_20170515_152232

Plus, having all that on just a single library like react-native-fetch-blob would be just great.