AppleTV (tvOS) with React Native

Written by Paul

How to setup

https://github.com/react-native-tvos/react-native-template-typescript-tv ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.
Expo๋Š” ์“ฐ์ง€ ์•Š๊ณ , React Native CLI ๋ฅผ ์ผ๊ธฐ ๋•Œ๋ฌธ์—
$ npx react-native init MyApp --template react-native-template-typescript-tv
์œ„ ๋ช…๋ น์–ด๋กœ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ TV OS ๋ฆฌ์•กํŠธ ๋„ค์ดํ‹ฐ๋ธŒ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

react-native-tvos

package.json์„ ๋ณด๋ฉด, "react-native": "npm:react-native-tvos@^0.71.10-0" ์™€ ๊ฐ™์ด react-native ํŒจํ‚ค์ง€๊ฐ€ react-native-tvos ์˜ ํŠน์ • ๋ฒ„์ „์œผ๋กœ ์ž๋ฆฌ ์žกํžŒ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ํ•ด๋‹น ํŒจํ‚ค์ง€๋Š” https://github.com/react-native-tvos/react-native-tvos ์—์„œ ๊ด€๋ฆฌ๋˜๋Š” react-native ๋ฅผ ๋”ฐ๋ผ๊ฐ€๋Š” tv os์šฉ ํŒจํ‚ค์ง€๋กœ ์˜ˆ์ƒ๋ฉ๋‹ˆ๋‹ค.

pod install

์šฐ๋ฆฌ๋Š” ์• ํ”Œ ํ‹ฐ๋น„ (Apple TV) ์˜ tvOS ๋งŒ ํƒ€๊ฒŸํŒ… ํ•  ์˜ˆ์ •์ด๋ฏ€๋กœ, pod install ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ ํ•ด ์ค๋‹ˆ๋‹ค.
$ cd MyApp $ bundle install # if you didn't do this cli, you have to. $ cd ios $ pod install

tv OS target

notion image
ย 
tvOS ๋ฅผ ์‹คํ–‰ ์‹œํ‚ค๋ ค๋ฉด, ์œ„ ์‚ฌ์ง„๊ณผ ๊ฐ™์ด -tvOS ํƒ€๊ฒŸ์„ ์„ ํƒํ•˜๊ณ  ์‹คํ–‰ ์‹œํ‚ค๋ฉด ๋ฉ๋‹ˆ๋‹ค.
apple TV ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๊ฐ€ ํ•„์š”ํ•˜๋ฏ€๋กœ, ์—†๋‹ค๋ฉด ํ•ด๋‹น ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๋ฅผ ์„ค์น˜ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

react-native-video with tvOS

๊ณต์‹๋ฌธ์„œ๋ฅผ ๋”ฐ๋ผ์„œ tvos ์„ค์ •์„ ํ•ด์ค˜์•ผ ํ•œ๋‹ค๊ณ ๋Š” ํ•˜๋Š”๋ฐ,
๋”ฐ๋กœ manual link๋ฅผ ๊ฑธ์ง€ ์•Š์•„๋„ ๋ฆด๋ฆฌ์ฆˆ ์Šคํ‚ค๋งˆ๊นŒ์ง€ ์ž˜ ์‹คํ–‰์ด ๋˜๊ธด ํ•ฉ๋‹ˆ๋‹ค.
ํ•ด๋‹น ๋ฒ„์ „์€ 5๋ฒ„์ „๋Œ€ ์ž…๋‹ˆ๋‹ค.

DRM

DRM ์ง€์›์˜ ๊ฒฝ์šฐ pallycon ์„œ๋น„์Šค๋กœ ํŒจํ‚ค์ง•์„ ํ•œ๋‹ค๋ฉด https://github.com/inka-pallycon/pallycon-multidrm-react-native-sample/blob/main/App.js ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. Widevine๊ณผ Fairplay์— ๋Œ€ํ•œ ์˜ˆ์ œ๊ฐ€ ๋‚˜์™€์žˆ์Šต๋‹ˆ๋‹ค.

react-native-reanimated with tvOS

์ˆœ์กฐ๋กญ๊ฒŒ 3๋ฒ„์ „๋Œ€์—์„œ ์ž˜ ์ž‘๋™ ํ•ฉ๋‹ˆ๋‹ค.
์ถ”๊ฐ€ ์ž‘์—… ํ•„์š” ์—†์Šต๋‹ˆ๋‹ค.

react-native-gesture-handler with tvOS

"react-native-gesture-handler": "^2.10.1" ๋ฒ„์ „์„ ์จ์•ผ ๋นŒ๋“œ๊ฐ€ ๋จ์„ ํ™•์ธ ํ–ˆ์Šต๋‹ˆ๋‹ค.
ย 
โ† Go home