1. Android - manifest, Activity, Application
1.1 Application
- ์๋๋ก์ด๋ Application์์ ์ ์ฒด ์ฑ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ class
- Event๋ฅผ ์ ๋ฌํ๊ธฐ ์ํ ํจ์๋ฅผ ์ ๊ณต
onCreate: ์ดํ๋ฆฌ์ผ์ด์ ์ด ์คํ๋ ๋ ์ต์ด์ ํธ์ถonTerminate: ์ดํ๋ฆฌ์ผ์ด์ ์ด ์ข ๋ฃ๋ ๋ ํธ์ถ
1.2 Manifest
- Android ์ฑ์ ๋ฉํ ์ ๋ณด๋ฅผ ์์ฝํด์ ์ ์ธ ํด ๋๊ฒ
- ๊ถํ, ์ด๋ฆ, ํจํค์ง๋ช ๋ฑ ์ฑ์ ์ ๋ฐ์ ์ธ ๋ด์ฉ๋ค์ ๋ด๊ณ ์์
- ์์น :
android/app/src/main/AndroidManifest.xml
1.3 Activity
- ์๋๋ก์ด๋์์ ํ๋ฉด์ ๊ตฌ์ฑ ํ๋ ์์
- ์ ์ ๊ฐ ์ง์ ๋ณด๊ณ , ๋๋ฅด๋ ๋ฑ์ ์ก์ ์ด ๋ฐ์๋จ
- ์๋๋ก์ด๋์ 4๊ตฌ์ฑ ์์ (activity, service, receiver, content provider)
Intent: ์ด๋ค Activity๋ฅผ ํธ์ถํ ๋ ์ฌ์ฉํ๋๊ฒ- ๋งค๊ฐ๋ณ์์ ํจ๊ป ๋ณด๋ด๋๊ฒ
- navigation์ ์ด๋ํ๋๊ฒ๊ณผ ๋น์ทํ ํํ
Activity Life-cycle: onCreate โ onResume โ onPause โ onDestroy
1.3.1 Intent-Filter
Intent-Filter: Intent๋ฅผ ์คํ ์ํฌ๋ ์ด๋ค ์ข ๋ฅ์ activity์ธ์ง๋ฅผ ๋น ๋ฅด๊ฒ ์ฐพ๊ธฐ ์ํ ์๋จ- Intent-Filter ๊ตฌ์กฐ
Action: activity๊ฐ ์ด๋ค ํ๋์ ์ ํจํ ๊ฒ์ธ์ง ๋ํ๋ด๋ ๊ฐ (ex SEND๋ฑ)Category: ์ด๋ค ์ข ๋ฅ์ ์กํฐ๋นํฐ ์ธ์ง๋ฅผ ๋ํ๋ด๋ ๊ฐ
1<intent-filter>2<action android:name="android.intent.action.MAIN" />3<category android:name="android.intent.category.LAUNCHER" />4</intent-filter>
- Intent-Filter์ ์ข
๋ฅ
ACTION_MAIN: ์ฑ์ ์์์ . ํํ๋ฉด์ ์์ด์ฝ์ด ๋ง๋ค์ด์งACTION_SEND: ๊ณต์ ํ๊ธฐ ์ก์ ๋ฑ์ด ํ์ํ ๋ ์ฌ์ฉ๋จACTION_DIAL: ์ ํ๋ฒํธ ํฐ ํจ๋์ ๊ฐ์ ํ๋ฉด์ด ํ์ํ ๋ ์ฌ์ฉ๋จ
2. iOS - Info.plist, AppDelegate
2.1 AppDelegate
- Android์์ activity์ฒ๋ผ ํ๋ฉด์ ๊ตฌ์ฑ ํ๋ ๋จ์
- ๊ฐ๊ฐ ์ฑ์ ์ํ์ ๋ฐ๋ผ ๋ถ๋ ค์ง๊ฒ ๋๋ ํจ์๊ฐ ์์
- ๋ค์์ iOS App status ๊ทธ๋ฆผ์ด๋ค.
1Not running โ Inactive โ Background โ Suspended2โ โ3Active
2.1.1 didFinishLaunchingWithOptions
์ฑ์ด ์ต์ด ์คํ๋ ๋ ํธ์ถ๋๋ ํจ์. (like android application onCreate)
2.1.2 Info.plist
- ๊ถํ, ์ฑ์ ์ด๋ฆ, ์คํ์ ์ฃผ๋ก ํ์ํ ๊ฐ๋ค์ ๊ด๋ฆฌ ํด์ฃผ๋ ํ์ผ
- SDK API Key๊ฐ, ๊ถํ ์์ฒญ์ ํ ์คํธ ๋ฑ ๊ฐ์ ๊ด๋ฆฌ
2.2 Build Phase
์ฑ์ ์คํ ์ํด์ ์์ด ํ์ํ ๊ฐ๋ค์ ์๋์ผ๋ก ์ค์ ํ๋๋ก Command๋ก ๋ชจ๋ ์ ์ธํด๋๊ฒ
3. Android / iOS Permissions
3.1 Permissions
ํน์ ๋ฆฌ์์ค๋ฅผ ํ์๋ก ํ ๋ ์ฌ์ฉ์์๊ฒ ํ์ฉ ํ ๊ฒ์ธ์ง ๋ฌผ์ด๋ณด๋๊ฒ
3.1.1 iOS Permissions flow
1Start โ available Device? โ already request? โ request โ granted2โ โ โ3unavailable โ โ4blocked, limited, granted โ5blocked
3.1.2 Android Permissions flow
1Start โ available Device? โ already request? โ request โ can request once?2โ โ โ โ3unavailable granted granted blocked
3.1.3 ์ถ๊ฐ๋ก ๋ ํ์ํ๊ฒ
- iOS - Info.plist ๊ถํ ์์ฒญ๋ฌธ
3.2 ์์ฃผ ์ฌ์ฉํ๋ ๊ถํ
์ฌ์ง ๊ด๋ จ- iOS - NSPhotoLibraryUsageDescription
- Android - READ_EXTERNAL_STORAGE
์นด๋ฉ๋ผ ๊ด๋ จ- iOS - NSCameraUsageDescription
- Android - WRITE_EXTERNAL_STORAGE
์์น ๊ด๋ จ- iOS - NSLocationAlwaysAndWhenInUseUsageDescription
- Android
- ACCESS_FINE_LOCATION
- ACCESS_COARSE_LOCATION
- ANDROID_BACKGROUND_LOCATION
AppTrackingTransparency- IDFA๋ฅผ ์ฝ์ด์ค๋ ๊ถํ
- iOS ์ฑ ์ฌ์ฌ์ ํ์๋ก ๋ณด๊ณ ์๋ ์ ๋ณด
4. Android / iOS Sceheme
4.1 Scheme
- ์ธ๋ถ์์ ์ฐ๋ฆฌ ์ฑ์ ํธ์ถํ๊ฑฐ๋, ์ฐ๋ฆฌ ์ฑ์ด ์ธ๋ถ์ฑ์ ํธ์ถํ๋ ์๋จ
test://path/to/screentest://๋ถ๋ถ : schemepath/to/screen๋ถ๋ถ : path
4.2 Scheme ์ ์ํ๋๋ฒ
4.2.1 Android
- intent-filter๋ฅผ ํตํด์ ์ ์
1<intent-filter>2<action android:name="android.intent.action.VIEW" />3<category android:name="android.intent.category.DEFAULT" />4<category android:name="android.intent.category.BROWSABLE" />5<data android:scheme="scheme" />6</intent-filter>
4.2.2 iOS
- Info.plist > URL Types์ ์ ์ฅ
4.3 Scheme ํ ์คํธํ๋๋ฒ
- uri-scheme package๋ฅผ ํตํ์ฌ ํ ์คํธ
1npx uri-scheme open "scheme://path" โ-ios2npx uri-scheme open "scheme://path" --android