Is it possible to download YouTube videos with Expo? - react-native

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.

Related

How can I keep the brigtness on call?

I am builded video call app with agora.io. but after a while the screen light turns off on both sides. I just have to keep the screens on during the video call. How can I do this without using plugins? I could not find such a thing in the agora documents.
this functionality is not provided by Agora. You have to use other external libraries for doing this. Expo keep awake is a fantastic solution. https://www.npmjs.com/package/expo-keep-awake
Make sure you have configured unimodules first before installing expo packages.

Recommended libraries for building an app which includes for deep linking and oauth

I have recently started to build a react-native app, which I want to build for both iOS and Android using a firebase Backend, and Branch.io/Firebase deep-linking services. I want to include in it both OAuth provided by Google and some kind of invitation link by using deep-linking. I have encountered problems in finding a way of supporting both.
It is worth mentioning that I am new to React and javascript, and have no experience in it.
I have tried using react-native-cli and tried to add OAuth to Google using firebase. I couldn't find enough documentation, so I followed a tutorial on youtube, and only managed to make it work by switching to Expo instead of react-native-cli.
Then I tried implementing some kind of invitation to groups in my app, using deep linking. I tried firebase's Dynamic links but got an error that firebase.links() is not a function and couldn't solve it due to lack of docs about it.
I then found out about react-native-branch library. It is in Alpha version in Expo so in order to use the native module I found out that I had to detach from Expo, and I wonder if there's an easier way to do it.
I've spent several days, as expected, in order to try and solve those issues. Is there a relatively simple way to do it?

Publishing expo app to App store/Google Play store

I'm currently developing an app with Expo. I've used Expo's Facebook API for users to sign in and realized that if I want to detach I'd have to use the React Native Facebook SDK. I've heard from many people that you can't publish an expo app to the app store, however, the expo website seems to say otherwise. Should I keep developing in Expo or detach and replace any of the expo imports I have?
You can easily generate a .apk or .ipa file with Expo and then upload it to the corresponding store (I have done this multiple times).
From Expo's docs:
The purpose of this guide is to help you create standalone binaries of your Expo app for iOS and Android which can be submitted to the Apple App Store and Google Play Store.
You can find detailed instructions on how to generate the binary files you need in this link.
What your friends might mean with "You can't publish an Expo app to the app store" is the publish command associated with Expo OTA updates. They even have a section explaining how to publish OTA updates to your standalone app.
A handy mindset when dealing with Expo is to think that "publishing" means using Expo's CLI tools to generate an OTA update, while "building" refers to the act of generating a new binary standalone file.
If you still need help with deploying your app to the app store check Expo's distribution guide.

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.

React native: How to use js library from cdn stripe.js

I want to use stripe.js library with React native which is only available with a cdn.
Is it possible to use a js library with a cdn only with react native?
If your goal was simply to integrate an external JavaScript file in your project, the best way might be to download the file from the CDN manually, or as part of your build process and simply require/import the local file in your app.
However, for using Stripe in your app, I'd recommend looking for a mobile-specific solution such as stripe-expo, or react-native-payments with the react-native-payments-addon-stripe. The stripe.js library is intended for browser use, and while it may work, mobile-specific SDKs are likely to work better in React Native.
Googling "react native stripe" turns out a few other third-party libraries as well. I haven't personally used any of them, but they may be worth evaluating.