-
Notifications
You must be signed in to change notification settings - Fork 2
[Feat/#24] Connection Client Interface를 구현 및 데모 앱을 통해 세션연결 확인 #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ConnectionClient Interface 구현 및 적용 기존 ConnectionClientImpl에서 채택하던 Delegate를 interface에서 채택 Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
기존에 Impl이 채택하던 delegate를 Interface에서 채택 Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
SignalingClient Interface에서 delegate 채택 Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
Co-Authored-By: Youngkyu Song <ace_lephant@naver.com>
모든 화면에서 이걸 해줘야하는건가..?
0Hooni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
저도 당연히 기본은 static이라 생각했는데 dynamic일 수도 있다는걸 이번에 처음 알게 되었네요
추가로 권한 설정 관련해서도 작업이 추가된것 같은데 연관 이슈가 있는걸로 알아서 이부분 체크도 해보심 좋을거 같습니다 ㅎㅎ
수고 많으셨습니다!
아 그러네요!! 연관 이슈도 연결해둘게요! |
hsw1920
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Secret이 Demo에도 필요하군요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맞습니다 흑흑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저흰 모듈화 원시인이니까 필요한 곳에 한땀한땀 추가해야합니다
| self.delegate?.signalClient(self, didReceiveCandidate: iceCandidate.rtcIceCandidate) | ||
| case .sdp(let sessionDescription): | ||
| self.delegate?.signalClient(self, didReceiveRemoteSdp: sessionDescription.rtcSessionDescription) | ||
| @unknown default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unknown 키워드 알아갑니다!
| func offer(completion: @escaping (_ sdp: RTCSessionDescription) -> Void) | ||
| func answer(completion: @escaping (_ sdp: RTCSessionDescription) -> Void) | ||
| func set(remoteSdp: RTCSessionDescription, completion: @escaping (Error?) -> Void) | ||
| func set(localSdp: RTCSessionDescription, completion: @escaping (Error?) -> Void) | ||
| func set(remoteCandidate: RTCIceCandidate, completion: @escaping (Error?) -> Void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기가 concurrency로 바뀔 예정일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞아요! 근데 작업 우선순위에 밀려 하고싶은 작업이 되었습니다..🥲
| private func setActions() { | ||
| offerButton.addAction(UIAction { [weak self] _ in | ||
| self?.connectionClient.sendOffer() | ||
| }, for: .touchUpInside) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIButton에 tapPublisher가 확장되어 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 맞네요ㅋㅋㅋㅋㅋ
🤔 배경
세션 연결을 위해 Connection Client를 구현했지만 정상적인 연결이 되는지 확인이 필요했습니다.
Feature 모듈에서 Connection Client를 사용하기 위해 Connection Client의 Interface를 구현했습니다.
closed #4
📃 작업 내역
✅ 리뷰 노트
1. Demo 앱에서의 의존성 관계 설정
Demo 앱에서 세션 연결을 테스트하기 위해서 기존 설계와 다르게 PhotoGetherDomain과 PhotoGetherNetwork를 Demo 앱이 의존하도록 설정했습니다.
테스트를 하기 위해서는 SceneDelegate에서 Connection Client를 생성해서 주입해줘야 됐습니다. 이를 위해 우선 PhotoGetherDomain을 의존해야 했습니다. 그리고 Connection Client를 생성하기 위해서는 WebSocketClient, SignalingClient, WebRTCClient를 생성해야 했는데 이 중에서 WebSocketClient의 구현체가 PhotoGetherNetwork에 있어서 추가적으로 의존성을 설정해줬습니다.
2. WebRTC 프레임워크를 찾지 못하는 오류
Demo 앱을 빌드해보니 WebRTC 프레임워크를 찾지 못해 앱이 터지는 현상이 발생했습니다. 이를 해결하기 위해 Demo 앱이 있는 Feature 모듈에 직접 Package Dependency를 추가해줬습니다. WebRTC 프레임워크의 README를 읽어보니 원인을 유추해볼 수 있었습니다.
바로 WebRTC 프레임워크는 Static Library가 아닌 Dynamic framework였던 것이었습니다. SPM으로 추가한 패키지는 당연히 Static Library일 것이라고 생각했지만 그렇지 않았습니다.
GPT 선생님의 말에 따르면 결국 해결책은 필요한 곳에서 Package Dependency를 추가해줘야 한다...라는 것 같습니다.
🎨 스크린샷
🚀 테스트 방법
WaitingRoomDemo 앱을 빌드하셔서 확인할 수 있습니다. 두 명이 앱을 실행시키고 한 명이 offer 버튼을 누르면 자동으로 answer되어 p2p 연결을 시도합니다. 연결이 되면 나와 상대방의 화면을 확인할 수 있습니다.