react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[React Native for X] TVOS

Open tpisto opened this issue 11 years ago • 79 comments

Any insights already about new Apple TVOS development using React Native?

tpisto avatar Sep 09 '15 19:09 tpisto

It should work with a couple of modifications although not all of the native modules are present since some of them don't make sense. Without having done any tvOS development, my current guess is you could get it running in a weekend.

ide avatar Sep 09 '15 19:09 ide

:+1:

dotcypress avatar Sep 09 '15 21:09 dotcypress

@ide Let me know if I can help you somehow, very excited about it!

Kureev avatar Sep 10 '15 20:09 Kureev

I'm not actively working on it. Someone smart should just do it. Go for it @Kureev.

ide avatar Sep 10 '15 20:09 ide

+1 (@Kureerv -- I'd be down to attempt help this weekend)

auser avatar Sep 11 '15 19:09 auser

I spent a little time this afternoon ripping bits and pieces out of react-native that don't play nice with tvOS and got the SampleApp running on tvOS:

https://github.com/jordanbyron/react-native/tree/tvOS

screen shot 2015-09-11 at 6 50 33 pm

Fair warning a lot is broken and still needs to be fixed:

  1. The developer menu is shot because tvOS does not support UIActionSheet.
  2. I commented out a few deprecated lines from RCTWebSocketExecutor.m
  3. Lists should always have at least three things. So insert your favorite emoji here :fire_engine:

Hopefully this can start as a jumping off point if anyone else wants to seriously get react-native support in tvOS.

jordanbyron avatar Sep 11 '15 23:09 jordanbyron

f5ff8bbf2baedef02048f6de48f8b821ad10334a9747e5bf630d78775c0dd61f

brentvatne avatar Sep 11 '15 23:09 brentvatne

jaw drop

rileybracken avatar Sep 11 '15 23:09 rileybracken

http://i.giphy.com/WXOs3HvaUw1Hi.gif

browniefed avatar Sep 11 '15 23:09 browniefed

54353572

ide avatar Sep 11 '15 23:09 ide

what a twist

michalgritzbach avatar Sep 12 '15 16:09 michalgritzbach

d404b18b5fa6b8513d14bac7ea68ed7a

SOSANA avatar Sep 12 '15 18:09 SOSANA

I hope you're happy @brentvatne. Look what you've done!

This afternoon I've been messing around with restoring the developer menu. Looking through Apple's new HIG for tvOS there isn't an equilivelent to UIActionSheet so I was thinking a left-aligned table would work just as well with buttons in each cell.

slice 1

That being said all of this is pushing my Obj-C / UIKit knowledge to the limits so if anyone with a bit more experience wants to help get the dev menu restored let me know. Luckily the CMD+D shortcut is still working so we have a way to toggle the menu while using the simulator. I haven't thought of any clever ways to activate the menu on real hardware vis-à-vis shaking on iOS. But that's a problem for later.

jordanbyron avatar Sep 12 '15 19:09 jordanbyron

@jordanbyron Nice work here. As for the dev menu when running on the hardware:

The new remote has built a built in gyro and accelerometer, so you could probably take advantage of that fairly easily with the new GCMotion class. Most notably, the userAcceleration property.

Another option is to use the Play/Pause button, and trigger the menu after it is pressed for 2 seconds or something (to avoid conflicting with what the app may want to do when that button was pressed). That is also fairly simple: Detecting Gestures and Button Presses (UIPressType.UIPressTypePlayPause)

dhrrgn avatar Sep 13 '15 04:09 dhrrgn

@jordanbyron Also, just noticed that tvOS does have Action Sheet support, but UIActionSheet has been replaced by UIAlertController. You just have to set the preferredStyle to UIAlertControllerStyleActionSheet.

Side Note: That class also replaces UIAlertView, so you would need to update RCTAlertManager to use that on tvOS (although I see you just removed that file altogether)

dhrrgn avatar Sep 13 '15 05:09 dhrrgn

@dhrrgn dude that's exactly what I was looking for! You rock :metal:

Check it out:

https://github.com/jordanbyron/react-native/commit/c7c4d9a941f6c0025633dd7bbbe6179d2a0f88f4

And

tvos-dev

jordanbyron avatar Sep 13 '15 15:09 jordanbyron

Wow. That was fast. Nooice

WillsonSmith avatar Sep 13 '15 16:09 WillsonSmith

sick

excited

thabti avatar Sep 13 '15 18:09 thabti

Image of Yaktocat

frankbolviken avatar Sep 14 '15 06:09 frankbolviken

great, there goes my productivity this week. awesome!

robwormald avatar Sep 14 '15 11:09 robwormald