[RN ์—๋Ÿฌ๋…ธํŠธ๐Ÿ”ฅ] ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ ๊นจ์ง? Info.plist์— ๋Œ€ํ•˜์—ฌ

๋„๋””ยท2020๋…„ 7์›” 30์ผ
1

RN ์—๋Ÿฌ๋…ธํŠธ ๐Ÿ”ฅ

๋ชฉ๋ก ๋ณด๊ธฐ
5/25
post-thumbnail

๐Ÿ‘‹๊ฐœ์š”

์•ˆ๋…•ํ•˜์„ธ์š”! ๋„๋””์˜ˆ์š”!
์˜ค๋Š˜์˜ ์—๋Ÿฌ๋…ธํŠธ๋Š” ์ œ๊ฐ€ ์—„์ฒญ๋‚œ ์‚ฝ์งˆ๋กœ ์ด๋ค„์ง„ ์—๋Ÿฌ์Šคํ† ๋ฆฌ๋ฅผ ๊ณต์œ ํ•˜๋ คํ•ฉ๋‹ˆ๋‹ค.

์•„์ง ์•ฑ์Šคํ† ์–ด, ํ”Œ๋ ˆ์ด์Šคํ† ์–ด ๋ฐฐํฌ ์ „์˜ ํšŒ์‚ฌ์•ฑ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ œ๋Œ€๋กœ ๋ณด์ด์ง„์•Š์ง€๋งŒ, ์•„๋ž˜์ฒ˜๋Ÿผ ๋‚˜์™€์•ผ ํ•˜๋Š”๋ฐ ์œ„์ฒ˜๋Ÿผ ๋ทฐ๊ฐ€ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋‚˜์˜ค์ง€ ์•Š๋Š” ๊ฒƒ์ด๋‹ค!!! ์ œ๋ฐœ ์ด๋Ÿฌ์ง€ ๋ง์•„๋‹ฌ๋ผ๊ตฌ.. ๋‚˜๋Š” ์ด ํ˜„์ƒ์„ ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๊ฐ€ ๊นจ์ ธ๋ณด์ธ๋‹ค ๋ผ๊ณ  ๋งํ•˜๊ณ  ๋‹ค๋…”๋‹ค..

์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๋ฅผ ์—…๋ฐ์ดํŠธ ํ•˜๊ธฐ๋„ ํ–ˆ๊ณ , ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๋Š” ์ฒ˜์Œ์— Xcode์„ค์น˜ํ•˜๋ฉด ๊ฐ™์ด ์„ค์น˜๊ฐ€ ๋˜๊ธฐ ๋•Œ๋ฌธ์— Xcode๋„ ๋‹ค์‹œ ์„ค์น˜ํ•ด๋ดค๋‹ค.
๋‹ฌ๋ผ์ง€๋Š”๊ฑด ์—†์—ˆ๊ณ , ๋นŒ๋“œ ํ• ๋•Œ ๋‚˜์˜ค๋Š” ์˜ค๋ฅ˜์— ๋Œ€ํ•ด ์ฐฌ์ฐฌํžˆ ์ฐพ์•„๋ณด๊ธฐ ์‹œ์ž‘ํ–ˆ๋‹ค. ๋ช‡์‹ญ๊ฐœ์˜ ํ•ด๊ฒฐ์ฑ…์ด๋ผ๋Š” ๋ฐฉ๋ฒ•๋“ค๋กœ ๋นŒ๋“œ ํŒŒ์ผ์„ ํด๋ฆฐํ•ด๋ณด๊ธฐ๋„ ํ•˜๊ณ , ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ๋„ ๋ฆฌ์…‹๋„ ๋ช‡์‹ญ๋ฒˆ์„ ํ•ด๋ดฃ๋‹ค.

๊ฒฐ๋ก ์€ Info.plist ํŒŒ์ผ์ด ์ž˜๋ชป๋˜์—ˆ๋˜ ๊ฒƒ์ด๋‹ค. ํ’•..

rn ์ž‘์—…์„ ํ•˜๋ฉด์„œ Info.plist ๊ฑด๋“ค์ด๋ผ๋Š”๊ฑด ์ด๋ฆฌ์ €๋ฆฌ ๋งŽ์ด ๋ดค๋Š”๋ฐ, ์†”์งํžˆ ์ด ํด๋”๊ฐ€ ๋ญ˜ ์˜๋ฏธํ•˜๋Š”์ง€๋„ ๋ชจ๋ฅด๋ฉด์„œ ๊ธ€์ž๋ฅผ ์ˆ˜์ •ํ•˜๊ธฐ๋งŒ ํ–ˆ๋‹ค. ์ด๋ฒˆ ๊ธฐํšŒ์— Info.plist๋ฅผ ๊นŠ๊ฒŒ ์‚ดํŽด๋ณด๊ณ ์ž ํ•œ๋‹ค.

๐Ÿ‘‹Info.plist, ์•ˆ๋…•?

ios>ํ”„๋กœ์ ํŠธ๋ช…>Info.plist ์— ์œ„์น˜ํ•ด ์žˆ๋Š” Info.plist๋Š” Xcode์—์„œ๋„ ์ •๋ณด๋ฅผ ํ™•์ธํ•ด๋ณผ ์ˆ˜ ์žˆ๋‹ค.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>ko</string>
	<key>CFBundleDisplayName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string></string>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
</dict>
</plist>

์ฝ”๋“œ๋Š” ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ๋‹ค. ์œผ.. ๋ณ„๋กœ ์นœํ•ด์ง€๊ณ  ์‹ถ๊ฒŒ ์•ˆ์ƒ๊ฒผ์ง€๋งŒ. ์นœํ•ด์ ธ๋ณด์ž.
๋ชจ๋“  ์•„์ดํฐ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์€ Info.plist๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. Info.plist๋Š” ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ด๋ฆ„์ด๋‚˜ ์•ฑ ์•„์ด์ฝ˜.. ๋“ฑ์˜ ๊ธฐ๋ณธ์ •๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. ์ž์„ธํ•˜๊ฒŒ ์–ด๋–ค ๊ธฐ๋ณธ์ •๋ณด๋“ค์ด ์žˆ๊ณ , ์–ด๋–ป๊ฒŒ ์ปจํŠธ๋กค์ด ๊ฐ€๋Šฅํ•œ์ง€ ํ•˜๋‚˜ํ•˜๋‚˜ ์ฒœ์ฒœํžˆ ์‚ดํŽด๋ณด๋„๋ก ํ•˜์ž.

๐Ÿšฅํ•˜๋‚˜ํ•˜๋‚˜ ์‚ดํŽด๋ณด๊ธฐ

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	// ๋ฒˆ๋“ค์˜ ์ฃผ ์–ธ์–ด ๋˜๋Š” ์ฃผ ์ง€์—ญ (type: string)
	<key>CFBundleDevelopmentRegion</key>
	<string>ko</string>
    
	// ์•„์ด์ฝ˜๊ณผ ๊ฐ™์ด ๋ณด์ด๋Š” ์•ฑ ์ด๋ฆ„ (type: string)
	<key>CFBundleDisplayName</key>
	<string>$(PRODUCT_NAME)</string>
    
	// ??
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
    
	// ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ณ ์œ  ์‹๋ณ„์ž, ์ผ๋ฐ˜์ ์œผ๋กœ com.ํšŒ์‚ฌ๋ช….ํ”„๋กœ์ ํŠธ๋ช…์œผ๋กœ ๊ตฌ์„ฑ (type: string)
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    
	// Info.plist ํ˜•์‹์˜ ๋ฒ„์ „ (type: string)
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
    
	// ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์‹ค์ œ ์ด๋ฆ„ (type: string)
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
    
	// ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰ OS ์ฝ”๋“œ, ๋ฒˆ๋“ค ์ข…๋ฅ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ฝ”๋“œ (type: string)
	<key>CFBundlePackageType</key>
	<string>AAAA</string>
    
	// ๋ฒˆ๋“ค์˜ ๋ฆด๋ฆฌ์ฆˆ ๋ฒ„์ „ (type: string)
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
    
	// ๋„ค๊ธ€์ž๋กœ ์ด๋ค„์ง„ ๋ฒˆ๋“ค ์‹๋ณ„ ์ฝ”๋“œ, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์ž์˜ OS ์ฝ”๋“œ
	<key>CFBundleSignature</key>
	<string>????</string>
    
	// ๋ฒˆ๋“ค์˜ ๋ฆด๋ฆฌ์ฆˆ ๋ฒ„์ „
	<key>CFBundleVersion</key>
	<string>1</string>
    
	// iOS์—์„œ๋งŒ ์‹คํ–‰ํ•  ๋ฒˆ๋“ค์ธ์ง€
	<key>LSRequiresIPhoneOS</key>
	<true/>
    
	// ๋ฐฐํฌ์‹œ์— ์ง€์›Œ์•ผ ํ•˜๋Š”๊ฒƒ, 
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>
    
	//์œ„์น˜ ์ •๋ณด์— ์ ‘๊ทผํ•ด์•ผ ํ•˜๋Š” ์ด์œ  (๊ถŒํ•œ ์š”์ฒญ ๋Œ€ํ™” ์ƒ์ž์— ํ‘œ์‹œ๋œ๋‹ค)
	<key>NSLocationWhenInUseUsageDescription</key>
	<string></string>
    
	// ? 
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
    
	// ์•ฑ ์‹คํ–‰์— ํ•„์š”ํ•œ ์š”๊ตฌ์กฐ๊ฑด๋“ค
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
    
	// ์•ฑ์ด ์ง€์›ํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค ๋ฐฉํ–ฅ, ๊ฐ€๋กœ๋ฒ„์ „, ์„ธ๋กœ๋ฒ„์ „ ์ง€์›ํ•˜๋Š”์ง€ ์•ˆํ•˜๋Š”์ง€
	// ์ž์„ธํ•œ ์ˆ˜์ •์€ ์•„๋ž˜๋ฅผ ์ฐธ๊ณ 
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
</dict>
</plist>

๐Ÿšฅ๋” ์ž์„ธํžˆ ์‚ดํŽด๋ณด๊ธฐ

UISupportedInterfaceOrientations

์•ฑ์ด ์ง€์›ํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค ๋ฐฉํ–ฅ, ๊ฐ€๋กœ๋ฒ„์ „, ์„ธ๋กœ๋ฒ„์ „ ์ง€์›ํ•˜๋Š”์ง€ ์•ˆํ•˜๋Š”์ง€
๋‚˜๋Š” ๋””๋ฐ”์ด์Šค๋ฅผ ๊ฐ€๋กœ๋กœ ํ•ด๋„ ์„ธ๋กœ๋งŒ ๋ณด์ด๊ฒŒ ํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค.

// before

<key>UISupportedInterfaceOrientations</key>
<array>
	<string>UIInterfaceOrientationPortrait</string>
	<string>UIInterfaceOrientationLandscapeLeft</string>
	<string>UIInterfaceOrientationLandscapeRight</string>
</array>

// after
<key>UISupportedInterfaceOrientations</key>
<array>
	<string>UIInterfaceOrientationPortrait</string>
</array>

์ฐธ๊ณ ๋กœ portrait์™€ landscape์˜ ์ฐจ์ด๋ฅผ ์œ„ํ•ด ์ด๋ฏธ์ง€๋ฅผ ํ•˜๋‚˜ ์ฒจ๋ถ€ํ•œ๋‹ค.

๐Ÿšฅ๋” ์•Œ์•„๋‘๋ฉด ์ข‹์„ Info.plist Key, value

...

์—ฌ๊ธฐ๊นŒ์ง€๊ณ , ํ”„๋กœ์ ํŠธ ์ƒํ™ฉ์— ๋งž๋Š” ์„ค์ •์„ ํ•ด์ฃผ์–ด์•ผ ์‚ฌ์šฉ์ž์˜ ๊ฒฝํ—˜๊ณผ ์‹ ๋ขฐ๋„์™€ ์—ฐ๊ฒฐ์ด ๋œ๋‹ค. ์ •ํ™•ํ•œ ์ •๋ณด๋ฅผ ํŒŒ์•…ํ•˜๊ณ  ์ž˜ ์„ธํŒ…ํ•ด์„œ ์ข€๋” ์™„์„ฑ๋„ ๋†’์€ ์•ฑ๊ฐœ๋ฐœ์„ ํ•˜์ž~~~

profile
์ถฉ์ „์ค‘..๐Ÿค”

0๊ฐœ์˜ ๋Œ“๊ธ€