generator-react-native-tvos v1.2.2
React Native tvOS App Generator
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.
A. Generate the React Native tvOS app on your Mac
Install yo
npm i -g yoInstall the generator
npm i -g generator-react-native-tvosUse the generator (it may tell you to install / upgrade
node,yarn,react-native-cli)yo react-native-tvosDefine 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
B. Start the backend API in a terminal window
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 serverMake 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
C. Xcode setup
From app folder link react native libraries
react-native linkOpen
ios/[appName].xcodeprojwith XcodeChange device to be able to run tvOS target
Change the target to
[appName]-tvOSyou have to run, from Xcode centre sectionUnder
[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 LibrariesUnder Build Phase, make sure you have all the fonts added under
Copy Bundle Resources:Lato,Roboto,Ubuntu(the whole font families must be added) andFontAwesomeFrom 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 startRun 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