Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVEventHandler is not working with react-native-view in Android #21259

Closed
3 tasks done
TheHemantKaushik opened this issue Sep 22, 2018 · 4 comments
Closed
3 tasks done
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@TheHemantKaushik
Copy link

TheHemantKaushik commented Sep 22, 2018

Environment

React Native Environment Info:
System:
OS: Linux 4.15 elementary OS 0.4.1 Loki
CPU: x64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
Memory: 566.45 MB / 7.70 GB
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 8.11.1 - ~/Work/Installations/node/bin/node
Yarn: 1.9.4 - ~/Work/Installations/node/bin/yarn
npm: 6.1.0 - ~/Work/Installations/node/bin/npm
SDKs:
Android SDK:
Build Tools: 26.0.0, 27.0.3, 28.0.0
API Levels: 19, 23, 26, 27, 28
npmPackages:
@types/react: 16.4.14 => 16.4.14
@types/react-native: 0.56.23 => 0.56.23
react: 16.5.0 => 16.5.0
react-native: v0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1

Description

I am developing an app for TV's. There is an intro video screen in this app. On this screen, I am using remote "select" button to play pause video. (There is no play/pause button in some remotes eg. MI Box). I am using "TVEventHandler" class to listen remote keys and printing values in console. But there is no value in console when I press any key from remote. It is not working as expected on Android.

Reproducible Demo

I am logging events in console. You can attach debugger to check console logs.
Here is a dropbox link of demo app:
https://www.dropbox.com/s/1ch84lyo2lh5vjx/RN57.zip?dl=0

@react-native-bot react-native-bot added Platform: Android Android applications. 🔶Components Platform: Linux Building on Linux. labels Sep 22, 2018
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@TheHemantKaushik
Copy link
Author

@react-native-bot I am using latest version 0.57. You can check it from environment info.

@sJJdGG
Copy link

sJJdGG commented Sep 23, 2018

@TheHemantKaushik You can only receive those kind of events if and only if a touchable is at focus in your root component.
You have no touchable component in your app.
if you don't need to have any, just add one with opacity 0 and make sure it has hasTVPreferredFocus prop set as true so it's already at focus at mount.
If you think this behavior is odd and/or a regression fell free to close this one make a new issue about the react native behavior to know maintainers thoughts on this.

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Oct 8, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Oct 8, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants