https://github.com/developeracademy-postech/2024-nc2-m4-push_to_talk
Apple Developer Academy 3rd Morning Session NC2 Pair4(Arthur&Keenie)'s Push to Talk
https://github.com/developeracademy-postech/2024-nc2-m4-push_to_talk
Last synced: about 1 month ago
JSON representation
Apple Developer Academy 3rd Morning Session NC2 Pair4(Arthur&Keenie)'s Push to Talk
- Host: GitHub
- URL: https://github.com/developeracademy-postech/2024-nc2-m4-push_to_talk
- Owner: DeveloperAcademy-POSTECH
- Created: 2024-06-17T00:40:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-20T20:16:46.000Z (8 months ago)
- Last Synced: 2024-11-17T06:16:36.415Z (3 months ago)
- Language: Swift
- Size: 193 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 2024-NC2-M4-Push_to_Talk
Apple Developer Academy 3rd Morning Session NC2
Pair4(Arthur&Keenie)'s Push to Talk
**TTBBANGBBANG๐**## ๐ฅ Youtube Link
(์ถํ ๋ง๋ค์ด์ง ์ ํ๋ธ ๋งํฌ ์ถ๊ฐ)## ๐ก About Push To Talk
### Push To Talk์ด๋?
**iOS์ ์ค๋์ค ์ปค๋ฎค๋์ผ์ด์ class**๋ก iOS ์ฑ์์ ์ํคํ ํค ํต์ ์ ํตํด
๋น ๋ฅธ ์ปค๋ฎค๋์ผ์ด์ ์งํํ๋๋ก ๋์์ฃผ๋ Framework (๋ฌด์ ๊ธฐย ๊ธฐ๋ฅ)
(watchOS5.3, iOS16 ์ด์๋ถํฐ ์ฌ์ฉ ๊ฐ๋ฅ)### Push To Talk์ ๊ธฐ๋ฅ
* ์ค์๊ฐ์ผ๋ก ์ ๋ณด ๊ณต์ ๊ฐ ๊ฐ๋ฅํ๋ค
* ๊ฐ์ ์ฑ๋์ ์๋ ์ฐธ๊ฐ์๋ค์๊ฒ ๋์์ ์ ๋ณด ์ ๋ฌ์ด ๊ฐ๋ฅํ๋ค
* ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์คํํ๊ณ ์์ด๋ ๋ฐฐํฐ๋ฆฌ ์๋ชจ๊ฐ ์ ๋ค
* ์ฌ๋ฌ ๋ช ์ด ์ฑ๋์ ์์ ์ ํ ๋ฒ์ ํ ์ฐธ๊ฐ์๋ง ๋งํ ์ ์๋ค.
* ์ด๋ค ์ฐธ๊ฐ์๊ฐ ์ด์ผ๊ธฐ๋ฅผ ํ๊ณ ์๊ณ , ์ด๋ค ์ฐธ๊ฐ์๊ฐ ๋ฃ๊ณ ์๋์ง ๋ณด์ฌ์ฃผ์ด์ผ ํ๋ค.
* ์ฑ ์คํ ์ ๋ง์ดํฌ ์ ๊ทผ ๊ถํ์ ๋ํ ํ์ฉ์ ์์ฒญํด์ผ ํ๋ค.## ๐ฏ What we focus on?
PushToTalk์ ์ด์ฉํ๋ฉด ์ฑ๋ ๋ด์ ์๋ ์ฌ์ฉ์๋ค๊ณผ ๊ฐ๋จํ๊ฒ ์ํต์ด ๊ฐ๋ฅํ๋ค. ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์๋ชจ๋๊ณ ์์ด๋ ๋ฐฐํฐ๋ฆฌ ์๋ชจ๊ฐ ์ ๊ณ ์ฆ๊ฐ์ ์ธ ์ ๋ณด์ ๋ฌ๊ณผ ์ต๋์ด ๊ฐ๋ฅํ๋ค.## ๐ผ Use Case
๋งค์ผ ์นดํ์ ํ๋ ๊ทธ๋ฃน์ ๊ตฌ์ฑ์๋ค๋ผ๋ฆฌ ์นดํ ์ ์ฝ๊ฒ ์ค์๊ฐ ์ ๋ณด(๋์ฐฉ์๊ฐ๊ณผ ์์น)๋ฅผ ๊ณต์ ํ ์ ์๊ฒ ํด์ฃผ์.## ๐ผ๏ธ Prototype

## ๐ ๏ธ About Code
##### PTT Channel Manager & Channel UUID & Channel Descriptor ์ ์ธ
```
var channelManager: PTChannelManager!let channelUUID = UUID()
let channelDescriptor = PTChannelDescriptor(name: "Channel Name", image: UIImage(systemName: "person"))
```
##### PTT Channel Manager ์ค์
```
channelManager = try await PTChannelManager.channelManager(delegate: self, restorationDelegate: self)
```
##### Channel ์ฐธ๊ฐ ์์ฒญ ๋ฉ์๋
```
channelManager.requestJoinChannel(channelUUID: channelUUID, descriptor: channelDescriptor)
```
##### Channel ์ค๋์ค ์ ์ก ์์ฒญ ๋ฉ์๋
```
channelManager.requestBeginTransmitting(channelUUID: channelUUID)
```
##### Channel ์ค๋์ค ์ ์ก ๋ฉ์๋์ ํธ์ถ์ด ์ฑ๊ณต์ ์ด์์ ๋, ์ฝ๋ฐฑ๋๋ ๋ฉ์๋
```
func channelManager(_ channelManager: PTChannelManager,
channelUUID: UUID,
didBeginTransmittingFrom source: PTChannelTransmitRequestSource) {
}
```
##### ์ค๋์ค์ ํ์ฑํ๋์์ ๋, ์ฝ๋ฐฑ๋๋ ๋ฉ์๋
```
func channelManager(_ channelManager: PTChannelManager,
didActivate audioSession: AVAudioSession) {}
```
##### ์๋ฒ์์ PTT Notification์ ๋ฐ์์ ๋(๋ค๋ฅธ ์ ์ ์ Audio๋ฅผ ๋ฐ์์ ๋), ์ฝ๋ฐฑ๋๋ ๋ฉ์๋
```
func incomingPushResult(channelManager: PTChannelManager, channelUUID: UUID, pushPayload: [String : Any]) -> PTPushResult {
let activeSpeakerName = pushPayload[โactiveSpeakerโ]
let activeSpeakerImage = getActiveSpeakerImage(name: activeSpeakerName)
return .activeRemoteParticipant(PTParticipant(name: activeSpeakerName,
image: activeSpeakerImage))
}
```