File Upload in Android WebView - file-upload

I was wondering, is there any way to simulate the File Upload using javascript interface provided by android webview?
Currently Android KitKat doesn't support file upload and i can not wait for next update.
Can anybody help me on this?

This similar stackoverflow question demonstrates that it can be done, and links to a Cordova plugin to achieve what you want. From looking at that plugin source code you should be able to see how to do it ;)

Related

Is it possible to download YouTube videos with Expo?

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.

How can I download configs and assets on first run in my react native application?

I'm trying to build a game using react native, and I need to have a loading screen in start of application to download latest app configs and assets such as images, fonts,... . I'm wondering how can I achieve that?
is there any library that can help me?
I read about "rn-fetch-blob" and "react-native-fs", are these the only ways? I don't want to get users permission for assets which are going to be used only in my application.
if you cloud please help me with your advice.
Thanks.
You can use remote database like FireBase (Firestore) to handle all your configurations, Paths ... etc
You can follow this tutorial to setup FireStore in your application
https://medium.com/react-native-training/firebase-sdk-with-firestore-for-react-native-apps-in-2018-aa89a67d6934
Hopefully this answers your question

How can I share a file using react-native and expo on android without detaching?

I'm working on an app with Expo and would like the user be able to share a file (.vcf) with an application of their choice.
On iOS I have this working without issues using the default
Share.share({url: filetoshare})
However, the URL field only works for iOS. I read a suggestion to use
IntentLauncherAndroid.startActivityAsync('android.intent.action.SEND', {URI
: uri});
But this gives me the error:
No Activity Found To Handle Intent
Is there any way that I would be able to share a file without detaching on an android device?
If there is any additional information I could provide to make answering this question easier, please let me know. Thank you!

How can I make PDF files in a Unity WebGL build?

I am in the process of making a Unity WebGL App and I would like the user to be able to download a status report which pulls-in info from the app.
So far I have tested SharpPDF with which i am able to generate a pdf in the editor and standalone builds but not in the webGL build.
Any ideas
Thanks
You could make a jslib and use something like pdfkit.
https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
https://www.npmjs.com/package/pdfkit

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.