I have created a react-native app using expo. Now I am looking for share-extension to the app to import CSV data from email attachment to my app.
I have tried npm package but that does not work for me(I was not able to build my project with that npm package in Xcode)
I think react-native or expo does not have any share API
In this picture, you can see how he got the option to import data into the app.
I understand that without share extension API, I think react-native and Expo both are useless because you can create the app but you don't expand it.
Looking for the solution or any other alternate solution.
I'm afraid this is not possible with expo.
First of all, are you looking for a way to create your own extension, or do you just want your app to be in the "open with list" that you have in the screenshot on the right? (Sharing and "open with" are two distinct things.)
If you just want your app to be listed in the standard "open with list", you do not need to use github.com/alinz/react-native-share-extension since it serves a different purpose. To quote the repo:
This is a helper module which brings react native as an engine to drive share extension for your app.
So with the package you can use react native to create your own share extension
To get your app into the "open with list", you need to go to target settings and change it according to the screenshot (example for MS word). Read more about it here. However, I'm afraid you won't be able to do this with expo without ejecting.
How to get the url of the file in react-native? You need to make sure that libRCTLinking.a is in the Link Binary with Libraries in Xcode (it'll probably be there already). And then you can follow the docs and call Linking.getInitialURL to get the file url. Then it really depends on what you want to do with the file. If you need something complicated, you'll likely need to write native code. If you just want to upload the file to some server, then you can make use of blob support that was added to RN 0.54 in this commit. An example of how to use the blob support is here.
Related
I'm using onedrive from my school, and unfortunately I made my name of onedrive in korean(my country language). And It made lots of error in Android studio.. I can't start my react-native project since 2 weeks ago. Is it unpossible to make React-Native without Android Studio?
If It's not possible, I would buy another onedrive..
I don't know what you have tried already, but you might try Expo. It lets you test your apps on a real device by scanning a QR code with the Expo Go Mobile App without manual building for iOS or Android.
This article has some useful steps.
The official Website his here.
I also recommend not using OneDrive (if possible). You should use a source control provider like GitHub to store and save your code. This will solve all your problems with OneDrive, and it is free. It will also let you use Android Studio as long as your folders and files have their names in Latin/ASCII characters.
If you use OneDrive, you will run into problems with huge files taking up all of your storage after you build your app for the first time.
I'm looking at being able to download YouTube videos within a React Native app created with Expo. I'm currently using Expo's FileSystem.downloadAsync, however this requires a direct URL to the resource to download. I've come across quite a few packages such as youtube-dl but they all require Node.JS to run.
My next thought was to use Node.JS within my app using nodejs-mobile - until I found out that you need to eject from Expo, which I definitely don't want to do.
Does anyone know of a way to download a YouTube video within an Expo app? Or just simply get a direct file link to pass into FileSystem.downloadAsync?
You might be able to use react-native-ytdl to get the direct video URL via their getInfo method (see this example) and then still use FileSystem.downloadAsync to download the file(s).
Since no linking is required, you wouldn't need to eject.
Basically the title says everything.
I want to create a basic WebDav Client to create, download and delete files from the webdav Server.
But I was unable to find a library which is able to achieve this in React Native.
Any suggestions?
I really don't want to write native code for it...
Another thing is that basic authentication has to be possible.
Thanks,
TK
webdav-fs works on React Native after installing react-native-crypto, stream and shimming Node.js core modules (as described here: https://www.npmjs.com/package/react-native-crypto).
Another step I had to take is to uncomment require("crypto"); in the file shim.js created by rn-nodeify.
webdav seems to work.
But in order to compile, I had to install a few standard node modules that are not in react native : stream-browserify (to replace stream), events, buffer, + I replaced crypto by md5.
not sure, but typescript support for the project may be necessary, too.
Right now I am trying to add sqlite-storage(https://github.com/andpor/react-native-sqlite-storage) and react-native-fs(https://github.com/itinance/react-native-fs/) to a project being done in react-native. Both, however, require me to add some lines of code to the ios and android files. Case is, I created this project using expo, and expo doesn't seem to have those files available.
Currently, I am trying to create some sort of offline storage for my app (I think I'll ditch sqlite because it won't be as necessary and just keep the react-native-fs and write the data on JSON).
I have already tried linking and re-installing it many times and it doesn't seem to work, since it keeps returning the "RNFSManager is undefined" error when I use react-native-fs. A few of the people with this problem I found said they had to manually link, but they all had access to those files I don't have (like setting and gradle, things expo doesn't give me direct access to), so I am not sure what I should do.
SQLite and FileSystem are both included on expo.
First you need to add them to your project with:
expo install expo-sqlite
expo install expo-file-system
Then you only need to import them
import { SQLite } from 'expo-sqlite';
import * as FileSystem from 'expo-file-system';
For more info you can check the expo docs for
FileSystem
and
SQLite
You will need to eject your expo project, so the android and ios folder will be created.
After that, you will be able to add nativecode to your react-native app.
The expo documentation is nicely done, you will have all the infos about the pros and cons of ejecting
I am working on a project already exists native base and I want to add expo to easily test my application.
The easiest way to do this is to make a new Expo project and copy over all the JavaScript from your existing project.
There isn't a way to react-native link expo or anything like that right now. There might be in the future but even then that wouldn't enable the easy sharing that you want. To get that you need to just use the binary code included with Expo (which can do most things you want to do).
Here is more info: https://docs.expo.io/versions/latest/introduction/faq.html#how-do-i-get-my-existing-react-native-project-running-with-expo
Expo can now be added to an existing project, run the following command for automatic installation:
npx install-expo-modules#latest
If the command fails, you can refer to the docs for manual installation instructions.