Giter VIP home page Giter VIP logo

Comments (4)

lucasferreira avatar lucasferreira commented on August 15, 2024

Hi @RUIFERNANDE5

I'm guessing that is not possibile since we had JavaScript doing this "bridge" between RN and Native APIs, so we have to work with "strings"/text instead of Blob and files in method parameters.

But vcard/text are text/plain "files" so if you read the file content before call some JS methods, in this specifically case, it mighty be possibible.

from react-native-send-intent.

RUIFERNANDE5 avatar RUIFERNANDE5 commented on August 15, 2024

Thank you for your fast feedback @lucasferreira, but could you elaborate a bit more please?
I would have to modify this module source code though, right? I can't just use the openChooserWithOptions method, correct?

If you don't plan on adding this feature, can you recommend any other package that does the job?

from react-native-send-intent.

lucasferreira avatar lucasferreira commented on August 15, 2024

The method openChooserWithOptions was not built by me. It's a contribuition made in this PR: #26

I can't help you with the "read vcard file" thing, but since you got the vcard content in string format you could try something like that:

const myVCardContent = `BEGIN:VCARD
VERSION:3.0
N:Gump;Forrest;;Mr.;
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
EMAIL:[email protected]
REV:2008-04-24T19:52:43Z
END:VCARD`;

SendIntentAndroid.sendText(myVCardContent, 'text/vcard'); // or text/x-vcard

Using sendText method you could pass some "mime type" of your content, so your Android Device could "guess" what the best app to deal with this "mime type".

Finally I recommend you to test in real devices with proper apps installed to handle vcard files.

from react-native-send-intent.

RUIFERNANDE5 avatar RUIFERNANDE5 commented on August 15, 2024

@lucasferreira , yea that actually uses the share sheet I'm looking for showing my android device apps but I need the file itself not the content. Thank you anyway

from react-native-send-intent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.