davidohayon669 / react-native-youtube

A <YouTube/> component for React Native.
MIT License
1.15k stars 474 forks source link

"Get YouTube App" Android 11 #518

Open anthoninCL opened 3 years ago

anthoninCL commented 3 years ago

I've implemented react-native-youtube a long time ago in my app but it seems something has changed with Android 11 (not sure about it).

When I try to launch a video, I get a pop up saying "Get YouTube App. This app won't run without the YouTube App, which is missing from your device". I do have YouTube installed on my device.

Screenshot from 2021-06-02 12-13-06

I ran into this issue on a Samsung Galaxy A70 and even on an emulator, both having API 30.

martinhellwig commented 3 years ago

Hi :) The thing is that Android does not allow connections to other apps (like YouTube) by default since Android 11. You have to specify the allowed connection from your app to YouTube via the manifest. More info here: https://stackoverflow.com/questions/63909770/why-youtube-player-api-does-not-work-on-android-11

This info should be added at least to the readme of the react-native-youtube project

c-moyer commented 3 years ago

I'm having the same problem too on both an emulator and a physical device (Amazon Fire Stick). I reviewed the SO post @martinhellwig provided and tried all suggestions but couldn't get anything to work.

OmarBasem commented 2 years ago

The SO solution works. You need to add `

</queries>` before the application tag in manifest file.
c-moyer commented 2 years ago

So, Amazon Fire Sticks don't support this functionality which is why I was receiving the error.

rohitsingh2410 commented 2 years ago

@c-moyer @anthoninCL actually Firestick comes with Youtube tv. If you will notice the Sack overflow solution it is starting intent of "com.google.android.youtube" however the Youtube app you may have in Firestick is "com.google.android.youtube.tv". To fix this. please disable and force stop the Current Youtube you have in firestick. install a apk of youtube from the internet in firestick and then run your app with solution by StackOverFlow. It will work.