generator-react-native-tvos
v1.2.2
Published
React Native tvOS application generator
Downloads
9
Maintainers
Readme
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 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
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
nvm
for 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
3000
on your Mac
C. Xcode setup
From app folder link react native libraries
react-native link
Open
ios/[appName].xcodeproj
with XcodeChange device to be able to run tvOS target
Change the target to
[appName]-tvOS
you have to run, from Xcode centre sectionUnder
[appName]-tvOS
General Settings
, automatically manage signing for targets[appName]-tvOS
and[appName]-tvOSTests
(use the same Apple ID profile you have on your Apple TV, if this the case)Add
libRNFS.a
andlibRCTVideo.a
libraries (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.json
file and set the fieldactivated
totrue
for thatactivationCode
. Close the filebackend/activation.json
after you finish editing.Enjoy