React-native: Android TV Support?

Created on 25 Oct 2016  路  13Comments  路  Source: facebook/react-native

Are there any plans to add Android TV support?

Locked

Most helpful comment

React native components are easily rendered on Android TV without any necessary modifications and simple button elements go in and out of focus by clicking directional arrows from TV remote.
Only issue is to handle click from directional pad to onPress event of currently focused Touchable elements. We are currently trying to map key button events from [react-native-events](https://www.npmjs.com/package/react-native-keyevent) to onPress handler of Touchable elements as the module provides key code 23 for click of center key on android TV remote. You can give it a try if you want to and I will post updates on this thread if any progress happens from my team's side

All 13 comments

@facebook-github-bot stack-overflow

I am not aware of anyone who has Android TV plans. I had not even heard of Android TV before now. There is a bunch of Apple TV work in progress, though. If you're interested in getting more visibility into the Android-TV-in-React-Native cause, I suggest posting on Product Pains: https://productpains.com/product/react-native

@mkonicek tvOS is Apple's TV operating system, Android TV is a completely different platform

@9point6 Yup, sorry I read the question too quickly! :)

Are there any info about this? I'm not even sure why React Native should not work with Android TV, are there any differences?

@FezVrasta From our experience at www.smaf.tv there are various issues that need to be supported differently, for full cross-device support. To name one, there is the need for mapping the remote keys to actions (like "RIGHT", "LEFT", "BACK", "GREEN", etc.), so that events can be captured and callbacks act on them. These need to be consistent along all Android TV setups (and remotes), so someone needs to register them properly on the library (per possible device differences), etc. There are more differences compared to an Android phone environment (remember, a TV has no "touch" navigation and should always support navigation based on remote keys solely), so the whole design of an app should take this into consideration (and the library too).

I understand, but I wonder why shouldn't it compile at least? Someone could write a layer to make the directional keys work then.

React native components are easily rendered on Android TV without any necessary modifications and simple button elements go in and out of focus by clicking directional arrows from TV remote.
Only issue is to handle click from directional pad to onPress event of currently focused Touchable elements. We are currently trying to map key button events from [react-native-events](https://www.npmjs.com/package/react-native-keyevent) to onPress handler of Touchable elements as the module provides key code 23 for click of center key on android TV remote. You can give it a try if you want to and I will post updates on this thread if any progress happens from my team's side

@smhatre59 Did you have any luck with this?

Would love Android TV support too.

No I am working on some other projects now. Will get back to this one when I get time

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janmonschke picture janmonschke  路  3Comments

jlongster picture jlongster  路  3Comments

TrakBit picture TrakBit  路  3Comments

DreySkee picture DreySkee  路  3Comments

lazywei picture lazywei  路  3Comments