Is it possible to make a webdav client in React Native without the need of native code? - react-native

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.

Related

Any way to have NodeJS run locally with an Expo app?

After some investigation, I realized I'd have to detach/eject my Expo app in order to use libraries such as nodejs-mobile-react-native, a library that allows you to run (and ship) a NodeJS singleton thread with your client app.
So the problem here is that I can't use this library unless I detach - something that I've been doing my best thus far to avoid. It sees all references to this library as null and I've tried to even manually link it.
Is there perhaps another approach that someone knows of that allows you to run Node alongside React-Native, which is compatible with Expo?
I have also used Expo in the past and because of similar limitations I switched over to Native Development using Swift but, in your situations what you can do is:
expo eject
in the application directory to detach your app from expo, once you have done this then you will have a plain react native app, then you can add any nodejs packages compatible with React Native.
Done!

Share extension react native - expo

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.

How to make a library to work in React Native environement?

I'm new in React Native, please bear with me. I have a library, which works fine in NodeJS and in browser. I would like to make it usable in React Native too.
I created an example project, imported the library but it threw an exception - Unable to resolve module `http`. If I try to import the browser version, document is not available.
Since then I'm scratching my head - how am I supposed to make my library to work in React Native if neither the core NodeJS modules, nor document are available?
React Native does not have access to Node.js modules such as http, so any code that relies on that functionality is not going to work. You will have to remove or replace it. As for document, window and other DOM-specific APIs, RN does not use a DOM at all, instead it uses its own rendering mechanism that is coupled to the native APIs. You will also have to remove all those calls and replace them with React Native-compatible ones.

React Native replace bundle.js

Is it possible to make a native modules, that can replace main.bundle.js inside application? If UI changes user will not have to update application, application will just pull new js bundle.
Yes. There already are some libraries that do exactly that.
react-native-auto-updater is only the client part that does the update on the device. CodePush on the other hand is a complete solution that also helps you distribute your code.

Will react native be supported by windows?

will react native be supported by windows os?Or linux . I don't own a mac so i was wondering if facebook plans to release react native for windows or linux. i don't want to run virtual machine because it's too much of a hassle.
I had successfully run the react-native on windows with a few hack.
The gist is here gist
Windows support would be awesome but cannot promise an ETA. We'd be happy to review pull requests that will make the CLI work on Windows.
You could skip the CLI and start with the Sample app from examples, build it with Gradle and start the packager manually using node node_modules/react-native/packager/packager.js.
Discussion here: https://github.com/facebook/react-native/issues/2693
This is not official support but I figured out how to get things working on Windows in a way that allows you to use the react-native CLI as documented without having to modify the source code.
The main issue that I encountered was with the hardcoded references to sh in React Native's packager. I solved this by adding Cygwin's bin directory to my path. Others have provided solutions for this where they modify the source code to work on Windows but I'd prefer not to go that route in order to ease updating to newer versions of React Native.
The other two catches where having to enable virtualization in my BIOS in order to get HAXM support and having to load the debugger page manually.
I wrote up some notes on the complete process here and intend to keep this up to date with future release of React Native:
http://davidanderson.io/2015/10/18/a-step-by-step-guide-to-react-native-on-windows/