Yeoman generator to help you bootstrap your React Native tvOS (v0.54.1) project in seconds. You will get a functional application including navigation, redux, a local server ready for async calls, containers, screens, ready to use components, themes (styled components), i18n.
-
Install yo
npm i -g yo
-
Install the generator
npm i -g generator-react-native-tvos
-
Use the generator (it may tell you to install / upgrade
node,yarn,react-native-cli)yo react-native-tvos
-
Define the app screens
- Screen title
- Included components per screen, one or more of these: Featured List, Poster List (has pagination), Category List
-
Change into the app folder
-
Verify .env file from app folder to make sure it is using your Mac local ip address
-
Start API server
- node v8 is installed globally
yarn run server
- node v8 is only available inside the current terminal window (you are using
nvmfor example)
cd backend node server -
Make sure your Apple TV (4th generation and above) is connected to the same LAN as your Mac
-
If your Apple TV (4th generation and above) cannot access the API running on your Mac, you may have to check your firewall settings and / or expose port
3000on your Mac
-
From app folder link react native libraries
react-native link
-
Open
ios/[appName].xcodeprojwith Xcode -
Change device to be able to run tvOS target
-
Change the target to
[appName]-tvOSyou have to run, from Xcode centre section -
Under
[appName]-tvOSGeneral Settings, automatically manage signing for targets[appName]-tvOSand[appName]-tvOSTests(use the same Apple ID profile you have on your Apple TV, if this the case) -
Add
libRNFS.aandlibRCTVideo.alibraries (tvOS versions) toLinked Frameworks and Libraries -
Under Build Phase, make sure you have all the fonts added under
Copy Bundle Resources:Lato,Roboto,Ubuntu(the whole font families must be added) andFontAwesome -
From Deployment Info, change Deployment Target to 10.0
-
If node v8 is not installed globally, you need to run this also inside of a node v8 enabled terminal window
yarn run start
-
Run it on Apple TV (4th generation and above) device or Apple TV simulator
-
Using the activation code on the first screen, open
backend/activation.jsonfile and set the fieldactivatedtotruefor thatactivationCode. Close the filebackend/activation.jsonafter you finish editing. -
Enjoy