From 837cbbe76ce60bf9edc44e3a057f17eb4f6b797f Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Tue, 31 Jul 2018 12:28:27 +0300 Subject: [PATCH 01/27] Bumped up version to 0.2.129 --- Nynja/Resources/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nynja/Resources/Info.plist b/Nynja/Resources/Info.plist index 33aef8f47..a80a7a65a 100644 --- a/Nynja/Resources/Info.plist +++ b/Nynja/Resources/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 0.2.128 + 0.2.129 ConfServerAddress $(ConfServerAddress) ConfServerPort -- GitLab From fadab83876be91845acd49e8845453b99443751f Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 25 Jul 2018 10:42:52 +0300 Subject: [PATCH 02/27] Support receiving events for add remove streams --- .../Call/CallInProgressProtocols.swift | 4 ++++ .../Interactor/CallInProgressInteractor.swift | 8 +++++++ .../Presenter/CallInProgressPresenter.swift | 8 +++++++ .../View/CallInProgressViewController.swift | 5 +++++ .../Call/Interactor/CallInteractor.swift | 5 +++++ Nynja/Services/NynjaCommunicatorService.swift | 22 +++++++++++++++++++ 6 files changed, 52 insertions(+) diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index e80506a85..ccd21b7d1 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -37,6 +37,7 @@ protocol CallInProgressViewProtocol: class { func updateCallBy(status: CallStatus) func callFailed() func askEndOrLeave() + func didAddRemoteVideoStream() } protocol CallInProgressPresenterProtocol: class { @@ -70,6 +71,7 @@ protocol CallInProgressPresenterProtocol: class { func showMenuWith(groupCollectionCell: GroupCollectionViewCell) func endCall() func hangupCall() + func addRemoteVideoRenderer(inView view: UIView) } protocol CallInProgressInteractorOutputProtocol: class { @@ -87,6 +89,7 @@ protocol CallInProgressInteractorOutputProtocol: class { func update(participants: [NYNCallParticipant]) func callFailed() func askEndOrLeave() + func didAddRemoteVideoStream() } protocol CallInProgressInteractorInputProtocol: class { @@ -113,6 +116,7 @@ protocol CallInProgressInteractorInputProtocol: class { func removeCallMember(memberId: String) func endCall() func hangupCall() + func addRemoteVideoRenderer(inView view: UIView) } protocol ManageCallInProgressParticipantsProtocol: class { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index a23be1b3f..68d8ff86a 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -202,6 +202,14 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } + func didAddVideoStreamForCall(call: NYNCall) { + self.presenter.didAddRemoteVideoStream() + } + + func addRemoteVideoRenderer(inView view: UIView) { + NynjaCommunicatorService.sharedInstance + } + func stopTimer () { if timer != nil { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 5d7dd9c0d..5f24598cf 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -108,6 +108,14 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn self.view.askEndOrLeave() } + func didAddRemoteVideoStream() { + self.view.didAddRemoteVideoStream() + } + + func addRemoteVideoRenderer(inView view: UIView) { + self.interactor.addRemoteVideoRenderer(inView: view) + } + func remoteVideoStreamStopped() { //self.view.remoteVideoStreamStopped() self.view.setupUI() diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 00313129a..5868b674d 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -915,4 +915,9 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.present(alertVC, animated: true, completion: nil) } + + func didAddRemoteVideoStream() { + self.presenter.addRemoteVideoRenderer(inView: self.otherVideoView); + } + } diff --git a/Nynja/Modules/Call/Interactor/CallInteractor.swift b/Nynja/Modules/Call/Interactor/CallInteractor.swift index 7f93f5a5a..994256e68 100644 --- a/Nynja/Modules/Call/Interactor/CallInteractor.swift +++ b/Nynja/Modules/Call/Interactor/CallInteractor.swift @@ -289,6 +289,11 @@ class CallInteractor: CallInteractorInputProtocol, VoxServiceDelegate, NynjaComm sendCall(ncall: call) } + func didAddVideoStreamForCall(call: NYNCall) { + + } + + func sendCall(ncall: NYNCall) { let room = Room() room.id = ncall.externalInfo diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index 6d503e111..f91e1c02c 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -17,6 +17,7 @@ protocol NynjaCommunicatorServiceDelegate: class { func participantsUpdated(call: NYNCall) func incomingCallRinging(call: NYNCall) func conferenceCreated(call: NYNCall) + func didAddVideoStreamForCall(call: NYNCall) } extension NynjaCommunicatorServiceDelegate { @@ -27,6 +28,7 @@ extension NynjaCommunicatorServiceDelegate { func participantsUpdated(call: NYNCall){} func incomingCallRinging(call: NYNCall){} func conferenceCreated(call: NYNCall) {} + func didAddVideoStreamForCall(call: NYNCall) {} } class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDelegate, NYNCallManagerDelegate { @@ -373,6 +375,26 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele } } + func call(_ call: NYNCall, didAddStream streamId: String) { + let log = NSString(format: "callWithIdDidAddStream: ", self) as String + LogService.log(topic: .callSystem, text: log) + if let c = self.call{ + if c.callId.elementsEqual(call.callId) { + self.delegate?.didAddVideoStreamForCall(call: call) + } + } + } + + func call(_ call: NYNCall, didRemoveStream streamId: String) { + let log = NSString(format: "callWithIdDidRemoVeStream: ", self) as String + LogService.log(topic: .callSystem, text: log) + if let c = self.call { + if c.callId.elementsEqual(call.callId) { + + } + } + } + //MARK: NYNCallManagerDelegate func createConference(withRequest requestId: String, didSucceedWithId conferenceId: String) { let creator = getCreator(createId: requestId) -- GitLab From c32995a66b4e8c4296ee84a34786b8c8a598c56b Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Wed, 25 Jul 2018 13:40:44 +0300 Subject: [PATCH 03/27] fixed NY - 2123 --- Nynja/Modules/Main/MainProtocols.swift | 1 + .../Main/Presenter/MainPresenter.swift | 140 +++++++++--------- .../MainViewController+NavigateProtocol.swift | 1 - .../Main/WireFrame/MainWireframe.swift | 11 ++ 4 files changed, 83 insertions(+), 70 deletions(-) diff --git a/Nynja/Modules/Main/MainProtocols.swift b/Nynja/Modules/Main/MainProtocols.swift index e65ae3a40..2b10cc53c 100644 --- a/Nynja/Modules/Main/MainProtocols.swift +++ b/Nynja/Modules/Main/MainProtocols.swift @@ -33,6 +33,7 @@ protocol MainWireFrameProtocol: class { func showAddContactViaPhoneNumber() func showChatList() func showCreateConferenceCall() + func showNotImplemented() func sendAudio(withURL url: URL) func sendImage(with url: URL) diff --git a/Nynja/Modules/Main/Presenter/MainPresenter.swift b/Nynja/Modules/Main/Presenter/MainPresenter.swift index c8aac6342..6b1bfa048 100644 --- a/Nynja/Modules/Main/Presenter/MainPresenter.swift +++ b/Nynja/Modules/Main/Presenter/MainPresenter.swift @@ -8,11 +8,11 @@ import VoxImplant class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, ScheduleMessageDelegate, EditParticipantsDelegate { - + func returnToCall() { self.wireFrame.returnToCall() } - + weak var view: MainViewProtocol! var interactor: MainInteractorInputProtocol! var wireFrame: MainWireFrameProtocol! @@ -21,23 +21,23 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu func showQRReader() { wireFrame.showQRReader() } - + func showContacts() { wireFrame.showContacts() } - + func showProfile() { wireFrame.showProfile() } - + func showAddContactViaPhoneNumber() { wireFrame.showAddContactViaPhoneNumber() } - + func showHistory() { wireFrame.showHistory() } - + func showInviteFriends() { PermissionManager().requestContactsPermission { (status) in if status == .authorized { @@ -45,7 +45,7 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } } } - + func voiceCall() { if let name = wireFrame.getContact() { wireFrame.isVideo = false @@ -53,7 +53,7 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu interactor.call(name: name) } } - + func voiceGroupCall() { if let room = wireFrame.getRoom() { @@ -63,18 +63,20 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu //interactor.dialInGroup(name: room.id!) } } - + func videoCall() { - PermissionManager().requestCameraPermission { (status) in - if status == .authorized { - self.wireFrame.isGroup = false - self.performVideoCall() - } - } + + wireFrame.showNotImplemented() +// PermissionManager().requestCameraPermission { (status) in +// if status == .authorized { +// self.wireFrame.isGroup = false +// self.performVideoCall() +// } +// } } - + func videoGroupCall() { - + self.wireFrame.showNotImplementedAlert() // PermissionManager().requestCameraPermission { (status) in // if status == .authorized { @@ -83,22 +85,22 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu // } // } } - + private func performVideoCall() { if let name = wireFrame.getContact() { wireFrame.isVideo = true interactor.videoCall(name: name) } } - + func showChatList() { wireFrame.showChatList() } - + func sendAudio(withURL url: URL) { wireFrame.sendAudio(withURL: url) } - + func sendImage(_ image: UIImage) { guard let url = ResourceManager(permissionManager: PermissionManager()).savePhoto(image: image, setting: .highest) else { LogService.log(topic: .fileSystem, text: "error save image") @@ -107,51 +109,51 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu wireFrame.sendImage(with: url) } - + func sendVideo(with url: URL) { wireFrame.sendVideo(with: url) } - + func getRecentsLocation() -> [LocationType] { return wireFrame.getRecentsLocation() } - + func getStarredLocation() -> [LocationType] { return wireFrame.getStarredLocation() } - + func getRecentsMedia() -> [Media] { return wireFrame.getRecentsMedia() } - + func sendTyping(_ isTyping: Bool) { wireFrame.sendTyping(isTyping) } - + func showMyContacts() { wireFrame.showMyContacts() } - + func viewShowed() { self.wireFrame.viewShowed() } - + func isActionEnabled() -> Bool { return wireFrame.getContact() != nil } - + func logout() { self.interactor.saveLogoutState() self.interactor.logout() self.changeScreenToAuth() } - + func changeScreenToAuth() { self.wireFrame.logout() } - + func showMessages(contact: Contact,call: NYNCall, callVC: CallViewProtocol, isVideo: Bool = false) { - + if isVideo { if VoxService.sharedInstance.isRemoveVideoStream { view.showPartnerVideoViewWithPhotoURL(url: contact.avatarUrl) @@ -164,21 +166,21 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } self.wireFrame.showMessages(contact: contact, callVC: callVC,isVideo: isVideo) } - + func showMessages (room: Room, call: NYNCall, callVC: CallViewProtocol, isVideo: Bool = false) { - + self.view.showReturnToCall(call: call) self.wireFrame.showMessages(room:room, callVC: callVC, isVideo: isVideo) } func showMessages (room: Room, call: NYNCall, callVC: CallInProgressViewProtocol, isVideo: Bool = false) { - + self.view.showReturnToCall(call: call) self.wireFrame.showMessages(room:room, callVC: callVC, isVideo: isVideo) } - + func showMessages(contact: Contact, call: NYNCall, callVC: CallInProgressViewProtocol, isVideo: Bool) { - + if isVideo { if VoxService.sharedInstance.isRemoveVideoStream { view.showPartnerVideoViewWithPhotoURL(url: contact.avatarUrl) @@ -189,7 +191,7 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } else { self.view.showReturnToCall(call: call) } - + self.wireFrame.showMessages(contact: contact, callVC: callVC,isVideo: isVideo) } @@ -197,31 +199,31 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu func openMapView() { self.wireFrame.openMapView() } - + func showLanguageSettings() { self.wireFrame.showLanguageSettings() } - + func about() { self.wireFrame.showSplash() } - + func showNotificationsSettings() { self.wireFrame.showNotificationsSettings() } - + func showWheelPositionPicker() { self.wireFrame.showWheelPositionPicker() } - + func showBuildNumber() { self.wireFrame.showBuildNumber() } - + func showChangeNumber() { self.wireFrame.showChangeNumber() } - + func conferenceVoiceCall() { wireFrame.showAddParticipantsToCreateConferenceCall() } @@ -234,19 +236,19 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu func showThemePicker() { self.wireFrame.showThemePicker() } - + func showSecuritySettings() { self.wireFrame.showSecuritySettings() } - + func showSupport() { self.wireFrame.showSupport() } - + func showPrivacy() { self.wireFrame.showPrivacy() } - + func showContactsToShare() { self.wireFrame.showContactsToShare() } @@ -265,63 +267,63 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu assertionFailure("Contact not found") } } - + func deleteAccount() { self.interactor.deleteAccount() self.wireFrame.logout() } - + func showDataAndStorage() { wireFrame.showDataAndStorage() } - + func showSettingsDataAndStorage(with usageMode: DataDownloadAndUsageMode) { wireFrame.showSettingsDataAndStorage(with: usageMode) } - + func showMySelfChat() { if let contact = self.interactor.contact { self.wireFrame.showMySelfChat(contact: contact) } } - + func showQRGenerator() { self.wireFrame.showQRGenerator() } - + func showAddContactByUserName() { self.wireFrame.showAddContactByUserName() } - + func showEditName() { self.wireFrame.showEditName() } - + func showEditUsername() { - self.wireFrame.showEditUsername() + self.wireFrame.showEditUsername() } - + // MARK: Group func showAddParticipants() { self.wireFrame.showAddParticipants() } - + func showGroupsList() { self.wireFrame.showGroupsList() } - + func showGroupsOptions() { self.wireFrame.showGroupsOptions() } - + func showUILocker() { view?.showUILocker() } - + func hideUILocker() { view?.hideUILocker() } - + // MARK: - ScheduleMessageDelegate func scheduleMessageHasBeenSent() { //TODO: @@ -330,11 +332,11 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu // MARK: EditParticpantsDelegate func participantsUpdated(contacts: [Contact]) { - + } - + func participantsUpdated(result: ParticipantsResult){ - + switch result { case let .createGroupCall(contacts, room): interactor.createGroupCall(contacts: contacts, room: room) diff --git a/Nynja/Modules/Main/View/MainViewController+NavigateProtocol.swift b/Nynja/Modules/Main/View/MainViewController+NavigateProtocol.swift index 71d32c194..b32275c6e 100644 --- a/Nynja/Modules/Main/View/MainViewController+NavigateProtocol.swift +++ b/Nynja/Modules/Main/View/MainViewController+NavigateProtocol.swift @@ -106,7 +106,6 @@ extension MainViewController: NavigateProtocol { closeWheel(indexPath: indexPath) } - // MARK: - Chat Actions func showMap(indexPath: IndexPath?) { diff --git a/Nynja/Modules/Main/WireFrame/MainWireframe.swift b/Nynja/Modules/Main/WireFrame/MainWireframe.swift index a0e9f9191..a927345db 100644 --- a/Nynja/Modules/Main/WireFrame/MainWireframe.swift +++ b/Nynja/Modules/Main/WireFrame/MainWireframe.swift @@ -81,6 +81,17 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato AddParticipantsWireFrame().presentAddParticipants(navigation: contentNavigation!, main: self, selectedContacts: [], delegate: self.external, mode: .createConferenceCall, members:[] , room: nil) } + func showNotImplemented() { + + let alertVC = UIAlertController(title: "voice_call_the_feature_currently_unavailable".localized, message: nil, preferredStyle: .alert) + let okAction = UIAlertAction(title: "ok".localized, style: .cancel) { (action) in + alertVC.dismiss(animated: true, completion: nil) + } + alertVC.addAction(okAction) + + self.view?.present(alertVC, animated: true, completion: nil) + } + func showContactsToShare() { ContactsWireFrame().presentContacts(navigation: contentNavigation, contactsViewMode: .shareContact, mainWireFrame: self) -- GitLab From 3f68543fcfda098ca4f01e779394b16798163206 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 25 Jul 2018 21:14:17 +0300 Subject: [PATCH 04/27] prepared dsk as submodule --- .gitmodules | 8 ++++++++ Nynja.xcodeproj/project.pbxproj | 28 ++++++++++++++++++++++++++++ externals/mobile-sdk-s4 | 1 + 3 files changed, 37 insertions(+) create mode 100644 .gitmodules create mode 160000 externals/mobile-sdk-s4 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..b05092af3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "Mobile-SDK-S3"] + path = externals/mobile-sdk-ext + url = https://github.com/NYNJA-MC/Mobile-SDK.git + branch = sprint3 +[submodule "Mobile-SDK-S4"] + path = externals/mobile-sdk-s4 + url = https://github.com/NYNJA-MC/Mobile-SDK.git + branch = sprint4 diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index 0d17738fe..57de5a142 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -1972,6 +1972,13 @@ remoteGlobalIDString = 357809A21F9765CF00C9680C; remoteInfo = "Nynja-Share"; }; + 5B10967E2108E797000927F4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5B1096792108E797000927F4 /* sdk.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 5B87E4082088DE100063D5BB; + remoteInfo = NynjaSDK; + }; 5B80A2842102177B0008D6AD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; @@ -2565,6 +2572,7 @@ 5957BF589EEC24E6799EB4CF /* TimeZoneSelectorViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TimeZoneSelectorViewController.swift; sourceTree = ""; }; 59C99DD8A060B0BE6802110F /* AddContactPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AddContactPresenter.swift; sourceTree = ""; }; 5AEEB3D82E9CF02760DA4CE7 /* Pods-Nynja-Share.channels.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Nynja-Share.channels.xcconfig"; path = "Pods/Target Support Files/Pods-Nynja-Share/Pods-Nynja-Share.channels.xcconfig"; sourceTree = ""; }; + 5B1096792108E797000927F4 /* sdk.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sdk.xcodeproj; path = "externals/mobile-sdk-s4/src/sdk/ios/sdk.xcodeproj"; sourceTree = ""; }; 5B377AA90A6B6BA0120C31F1 /* EditProfileProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditProfileProtocols.swift; sourceTree = ""; }; 5BC1D37220D3B3D8002A44B3 /* NynjaCommunicatorService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NynjaCommunicatorService.swift; path = Services/NynjaCommunicatorService.swift; sourceTree = ""; }; 5BC1D37420D3B4A6002A44B3 /* GroupCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupCollectionViewCell.swift; sourceTree = ""; }; @@ -5525,6 +5533,7 @@ isa = PBXGroup; children = ( 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */, + 5B1096792108E797000927F4 /* sdk.xcodeproj */, A4A242442060370E00B0A804 /* Shared */, 3ABCE8EF1EC9330D00A80B15 /* Nynja */, 357809A41F9765CF00C9680C /* Nynja-Share */, @@ -6208,6 +6217,14 @@ path = WireFrame; sourceTree = ""; }; + 5B10967A2108E797000927F4 /* Products */ = { + isa = PBXGroup; + children = ( + 5B10967F2108E797000927F4 /* NynjaSDK.framework */, + ); + name = Products; + sourceTree = ""; + }; 5B2B64C658BEC3CCC90B0DEF /* WireFrame */ = { isa = PBXGroup; children = ( @@ -12182,6 +12199,10 @@ ProductGroup = 5B80A2812102177B0008D6AD /* Products */; ProjectRef = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; }, + { + ProductGroup = 5B10967A2108E797000927F4 /* Products */; + ProjectRef = 5B1096792108E797000927F4 /* sdk.xcodeproj */; + }, ); projectRoot = ""; targets = ( @@ -12193,6 +12214,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 5B10967F2108E797000927F4 /* NynjaSDK.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = NynjaSDK.framework; + remoteRef = 5B10967E2108E797000927F4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 5B80A2852102177B0008D6AD /* NynjaUIKit.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 new file mode 160000 index 000000000..ac718bbe6 --- /dev/null +++ b/externals/mobile-sdk-s4 @@ -0,0 +1 @@ +Subproject commit ac718bbe6583a604fc5ac458ebe2059171379202 -- GitLab From a283d6c0d65e63f1fde4b098890b468505efea70 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Tue, 31 Jul 2018 13:44:47 +0300 Subject: [PATCH 05/27] Fixed nynja-sdk as submodule --- Nynja.xcodeproj/project.pbxproj | 19 +++++++++++++++++-- Podfile | 2 +- externals/mobile-sdk-s4 | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index 57de5a142..a4b767544 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -612,6 +612,8 @@ 5A6237362268CC9BD4792230 /* EditUsernameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B772E08B9E40EB48DD87082 /* EditUsernameViewController.swift */; }; 5AD8110B5B87B1AB9F1C5B52 /* CreateGroupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CBACEAABEE65D7EC5572C4E /* CreateGroupPresenter.swift */; }; 5B5EE777EF301CFC1FDCF307 /* CreateGroupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFC76E2B3DD0BCA0A622A5CD /* CreateGroupInteractor.swift */; }; + 5B86631B21107304005B4146 /* NynjaSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B10967F2108E797000927F4 /* NynjaSDK.framework */; }; + 5B86631C21107304005B4146 /* NynjaSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5B10967F2108E797000927F4 /* NynjaSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 5BC1D37320D3B3D9002A44B3 /* NynjaCommunicatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37220D3B3D8002A44B3 /* NynjaCommunicatorService.swift */; }; 5BC1D37920D3B4A8002A44B3 /* GroupCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37420D3B4A6002A44B3 /* GroupCollectionViewCell.swift */; }; 5BC1D37B20D3B4A8002A44B3 /* GroupAddParticipantsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37620D3B4A7002A44B3 /* GroupAddParticipantsCollectionViewCell.swift */; }; @@ -1986,6 +1988,13 @@ remoteGlobalIDString = 8514D4C120EE27080002378A; remoteInfo = NynjaUIKit; }; + 5B86631D21107304005B4146 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5B1096792108E797000927F4 /* sdk.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 5B87E4072088DE100063D5BB; + remoteInfo = NynjaSDK; + }; 85C65C6A20EE58ED00C468B2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; @@ -2043,6 +2052,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 5B86631C21107304005B4146 /* NynjaSDK.framework in Embed Frameworks */, 85C65C7520EE5A5A00C468B2 /* NynjaUIKit.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -3776,6 +3786,7 @@ files = ( 85C65C7420EE5A5A00C468B2 /* NynjaUIKit.framework in Frameworks */, 63E6537BBBD814F6DF3DC589 /* Pods_Nynja.framework in Frameworks */, + 5B86631B21107304005B4146 /* NynjaSDK.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -12110,6 +12121,7 @@ 264FFA921FC590580028243D /* PBXTargetDependency */, 85C65C7220EE5A2800C468B2 /* PBXTargetDependency */, 85C65C7720EE5A5A00C468B2 /* PBXTargetDependency */, + 5B86631E21107304005B4146 /* PBXTargetDependency */, ); name = Nynja; productName = Nynja; @@ -12360,7 +12372,6 @@ "${BUILT_PRODUCTS_DIR}/JTAppleCalendar/JTAppleCalendar.framework", "${BUILT_PRODUCTS_DIR}/MDFTextAccessibility/MDFTextAccessibility.framework", "${BUILT_PRODUCTS_DIR}/MaterialComponents/MaterialComponents.framework", - "${PODS_ROOT}/NynjaSDK/NynjaSDK.framework", "${BUILT_PRODUCTS_DIR}/QRCode/QRCode.framework", "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", @@ -12385,7 +12396,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JTAppleCalendar.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MDFTextAccessibility.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponents.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NynjaSDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QRCode.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", @@ -14508,6 +14518,11 @@ target = 357809A21F9765CF00C9680C /* Nynja-Share */; targetProxy = 264FFA911FC590580028243D /* PBXContainerItemProxy */; }; + 5B86631E21107304005B4146 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = NynjaSDK; + targetProxy = 5B86631D21107304005B4146 /* PBXContainerItemProxy */; + }; 85C65C7220EE5A2800C468B2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = NynjaUIKit; diff --git a/Podfile b/Podfile index 8426e9e89..44ffe11b7 100644 --- a/Podfile +++ b/Podfile @@ -40,7 +40,7 @@ def commonPodsForNynja pod 'MaterialComponents/FlexibleHeader' pod 'JTAppleCalendar', '~> 7.0' - pod 'NynjaSDK', '~> 1.3.3' + #pod 'NynjaSDK', '~> 1.3.3' end def commonPodsForNynjaTests diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index ac718bbe6..4113952ad 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit ac718bbe6583a604fc5ac458ebe2059171379202 +Subproject commit 4113952adabfefe7cb96209c1fa1b4e503167e26 -- GitLab From 40abddbda6cbbd1e17e8d2330a1ed1f71fec7b77 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Tue, 31 Jul 2018 15:52:27 +0300 Subject: [PATCH 06/27] Enabled p2p video --- Nynja/Modules/Main/Interactor/MainInteractor.swift | 2 +- Nynja/Modules/Main/Presenter/MainPresenter.swift | 10 ++-------- externals/mobile-sdk-s4 | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Nynja/Modules/Main/Interactor/MainInteractor.swift b/Nynja/Modules/Main/Interactor/MainInteractor.swift index 85aa37b3b..ae50efbed 100644 --- a/Nynja/Modules/Main/Interactor/MainInteractor.swift +++ b/Nynja/Modules/Main/Interactor/MainInteractor.swift @@ -36,7 +36,7 @@ class MainInteractor: MainInteractorInputProtocol, VoxServiceDelegate, EditPhoto } func videoCall(name: String) { - //TODO: Call NynjaCommunicatorService with video true when ready + NynjaCommunicatorService.sharedInstance.call(user: name, withVideo: true) } func dialInGroup(name: String) { NynjaCommunicatorService.sharedInstance.dialInGroup(groupname: name) diff --git a/Nynja/Modules/Main/Presenter/MainPresenter.swift b/Nynja/Modules/Main/Presenter/MainPresenter.swift index 6b1bfa048..36e9076f5 100644 --- a/Nynja/Modules/Main/Presenter/MainPresenter.swift +++ b/Nynja/Modules/Main/Presenter/MainPresenter.swift @@ -65,14 +65,8 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } func videoCall() { - - wireFrame.showNotImplemented() -// PermissionManager().requestCameraPermission { (status) in -// if status == .authorized { -// self.wireFrame.isGroup = false -// self.performVideoCall() -// } -// } + self.wireFrame.isGroup = false + self.performVideoCall() } func videoGroupCall() { diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index 4113952ad..9a53de849 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit 4113952adabfefe7cb96209c1fa1b4e503167e26 +Subproject commit 9a53de849ff3f0cd99e77d67da8ceeaed552e12f -- GitLab From 7c18277dbe1fd73244275f269f9bd7b41fcdea92 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Tue, 31 Jul 2018 19:35:59 +0300 Subject: [PATCH 07/27] p2p video basic --- .../Interactor/CallInProgressInteractor.swift | 2 +- Nynja/Modules/Main/WireFrame/MainWireframe.swift | 1 + Nynja/Services/NynjaCommunicatorService.swift | 6 ++++++ externals/mobile-sdk-s4 | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 68d8ff86a..3e2ec2657 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -207,7 +207,7 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func addRemoteVideoRenderer(inView view: UIView) { - NynjaCommunicatorService.sharedInstance + NynjaCommunicatorService.sharedInstance.attachRemoteVideoRenderer(inView: view) } func stopTimer () { diff --git a/Nynja/Modules/Main/WireFrame/MainWireframe.swift b/Nynja/Modules/Main/WireFrame/MainWireframe.swift index a927345db..9ae36b073 100644 --- a/Nynja/Modules/Main/WireFrame/MainWireframe.swift +++ b/Nynja/Modules/Main/WireFrame/MainWireframe.swift @@ -564,6 +564,7 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato func presentCallInProgressViewForCall(call:NYNCall) { + self.isVideo = call.recvVideo let callMode: CallInProgressMode = self.isVideo ? .oneToOneVideo : call.isConference() ? .groupAudio : .oneToOneAudio if callMode == .groupAudio { diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index f91e1c02c..f395cf651 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -258,6 +258,12 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele }; } + func attachRemoteVideoRenderer(inView view: UIView) { + if let call = self.call { + call.attachRemoteRenderer(to: view) + } + } + //MARK: Helpers func getMySelf() -> Contact? { diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index 9a53de849..31c612f1d 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit 9a53de849ff3f0cd99e77d67da8ceeaed552e12f +Subproject commit 31c612f1dfc860cdb6e06e1e3fc5be8a86a5c78e -- GitLab From a7f8ef0ed00a62726c858f455a9e3be43443cf5f Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Thu, 2 Aug 2018 19:26:46 +0300 Subject: [PATCH 08/27] Local Video Preview Basic Version --- .../Call/CallInProgressProtocols.swift | 4 ++ .../Interactor/CallInProgressInteractor.swift | 12 ++++++ .../Presenter/CallInProgressPresenter.swift | 8 ++++ .../View/CallInProgressViewController.swift | 3 ++ Nynja/Services/NynjaCommunicatorService.swift | 38 +++++++++++++++++-- 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index ccd21b7d1..af00dec9c 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -38,6 +38,7 @@ protocol CallInProgressViewProtocol: class { func callFailed() func askEndOrLeave() func didAddRemoteVideoStream() + func didStartLocalCapturer() } protocol CallInProgressPresenterProtocol: class { @@ -72,6 +73,7 @@ protocol CallInProgressPresenterProtocol: class { func endCall() func hangupCall() func addRemoteVideoRenderer(inView view: UIView) + func attachLocalVideoPreview(inView view: UIView) } protocol CallInProgressInteractorOutputProtocol: class { @@ -90,6 +92,7 @@ protocol CallInProgressInteractorOutputProtocol: class { func callFailed() func askEndOrLeave() func didAddRemoteVideoStream() + func didStartLocalCapturer() } protocol CallInProgressInteractorInputProtocol: class { @@ -117,6 +120,7 @@ protocol CallInProgressInteractorInputProtocol: class { func endCall() func hangupCall() func addRemoteVideoRenderer(inView view: UIView) + func attachLocalVideoPreview(inView view: UIView) } protocol ManageCallInProgressParticipantsProtocol: class { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 3e2ec2657..7a1e8cab4 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -206,9 +206,21 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic self.presenter.didAddRemoteVideoStream() } + func didStartLocalCapturerForCall(call: NYNCall) { + self.presenter.didStartLocalCapturer() + } + + func didStopLocalCapturerForCall(call: NYNCall) { + + } + func addRemoteVideoRenderer(inView view: UIView) { NynjaCommunicatorService.sharedInstance.attachRemoteVideoRenderer(inView: view) } + + func attachLocalVideoPreview(inView view: UIView) { + NynjaCommunicatorService.sharedInstance.attachLocalVideoPreview(inView: view) + } func stopTimer () { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 5f24598cf..63a19999c 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -112,10 +112,18 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn self.view.didAddRemoteVideoStream() } + func didStartLocalCapturer() { + self.view.didStartLocalCapturer() + } + func addRemoteVideoRenderer(inView view: UIView) { self.interactor.addRemoteVideoRenderer(inView: view) } + func attachLocalVideoPreview(inView view: UIView) { + self.interactor.attachLocalVideoPreview(inView: view) + } + func remoteVideoStreamStopped() { //self.view.remoteVideoStreamStopped() self.view.setupUI() diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 5868b674d..78420d3d2 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -920,4 +920,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.presenter.addRemoteVideoRenderer(inView: self.otherVideoView); } + func didStartLocalCapturer() { + self.presenter.attachLocalVideoPreview(inView: self.myVideoView); + } } diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index f395cf651..1f5c6b9f7 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -18,6 +18,9 @@ protocol NynjaCommunicatorServiceDelegate: class { func incomingCallRinging(call: NYNCall) func conferenceCreated(call: NYNCall) func didAddVideoStreamForCall(call: NYNCall) + func didRemoveVideoStreamForCall(call: NYNCall) + func didStartLocalCapturerForCall(call: NYNCall) + func didStopLocalCapturerForCall(call: NYNCall) } extension NynjaCommunicatorServiceDelegate { @@ -29,10 +32,14 @@ extension NynjaCommunicatorServiceDelegate { func incomingCallRinging(call: NYNCall){} func conferenceCreated(call: NYNCall) {} func didAddVideoStreamForCall(call: NYNCall) {} + func didRemoveVideoStreamForCall(call: NYNCall) {} + func didStartLocalCapturerForCall(call: NYNCall) {} + func didStopLocalCapturerForCall(call: NYNCall) {} } class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDelegate, NYNCallManagerDelegate { + let nynComm: NynjaCommunicator var isCallInProgress = false weak var delegate : NynjaCommunicatorServiceDelegate? @@ -263,7 +270,13 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele call.attachRemoteRenderer(to: view) } } - + + func attachLocalVideoPreview(inView view: UIView) { + if let call = self.call { + call.attachLocalPreview(to: view) + } + } + //MARK: Helpers func getMySelf() -> Contact? { @@ -381,7 +394,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele } } - func call(_ call: NYNCall, didAddStream streamId: String) { + func call(_ call: NYNCall, didAddRemoteVideoTrack trackId: String) { let log = NSString(format: "callWithIdDidAddStream: ", self) as String LogService.log(topic: .callSystem, text: log) if let c = self.call{ @@ -391,16 +404,32 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele } } - func call(_ call: NYNCall, didRemoveStream streamId: String) { + func call(_ call: NYNCall, didRemoveRemoteVideoTrack trackId: String) { let log = NSString(format: "callWithIdDidRemoVeStream: ", self) as String LogService.log(topic: .callSystem, text: log) if let c = self.call { if c.callId.elementsEqual(call.callId) { - + self.delegate?.didRemoveVideoStreamForCall(call: call) } } } + func callDidStartLocalCapturer(_ call: NYNCall) { + if let c = self.call{ + if c.callId.elementsEqual(call.callId) { + self.delegate?.didStartLocalCapturerForCall(call: call) + } + } + } + + func callDidStopLocalCapturer(_ call: NYNCall) { + if let c = self.call{ + if c.callId.elementsEqual(call.callId) { + self.delegate?.didStopLocalCapturerForCall(call: call) + } + } + } + //MARK: NYNCallManagerDelegate func createConference(withRequest requestId: String, didSucceedWithId conferenceId: String) { let creator = getCreator(createId: requestId) @@ -611,4 +640,5 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func callStateDidChange(_ call: NYNCall) { self.messageInteractorCallProtocol?.didChangeCallInvitationState(call) } + } -- GitLab From 35286c0bfcb178cf8e3edb50e9fe8a2fd1f4e201 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Fri, 3 Aug 2018 13:27:40 +0300 Subject: [PATCH 09/27] Speaker action fix via Audio Manager instead of Vox --- .../Interactor/CallInProgressInteractor.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 3e2ec2657..bcff15bf3 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -93,7 +93,11 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func speakerAction() { - vox.switchSpeaker() + if AudioManager.sharedInstance.speaker == .loud { + AudioManager.sharedInstance.speaker = .soft + } else { + AudioManager.sharedInstance.speaker = .loud + } } func disableVideo() { -- GitLab From d5e9a82af809022e77c774a73cc5df07249a64a0 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Fri, 3 Aug 2018 14:56:49 +0300 Subject: [PATCH 10/27] Local video preview additions --- Nynja/Modules/Call/CallInProgressProtocols.swift | 4 ++++ .../Interactor/CallInProgressInteractor.swift | 10 +++++++--- .../Presenter/CallInProgressPresenter.swift | 8 ++++++++ .../View/CallInProgressViewController.swift | 16 ++++++++++------ Nynja/Services/NynjaCommunicatorService.swift | 12 ++++++++++++ externals/mobile-sdk-s4 | 2 +- 6 files changed, 42 insertions(+), 10 deletions(-) diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index af00dec9c..7cb9abce6 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -39,6 +39,7 @@ protocol CallInProgressViewProtocol: class { func askEndOrLeave() func didAddRemoteVideoStream() func didStartLocalCapturer() + func didStopLocalCapturer() } protocol CallInProgressPresenterProtocol: class { @@ -74,6 +75,7 @@ protocol CallInProgressPresenterProtocol: class { func hangupCall() func addRemoteVideoRenderer(inView view: UIView) func attachLocalVideoPreview(inView view: UIView) + func dettachLocalVideoPreview(inView view: UIView) } protocol CallInProgressInteractorOutputProtocol: class { @@ -93,6 +95,7 @@ protocol CallInProgressInteractorOutputProtocol: class { func askEndOrLeave() func didAddRemoteVideoStream() func didStartLocalCapturer() + func didStopLocalCapturer() } protocol CallInProgressInteractorInputProtocol: class { @@ -121,6 +124,7 @@ protocol CallInProgressInteractorInputProtocol: class { func hangupCall() func addRemoteVideoRenderer(inView view: UIView) func attachLocalVideoPreview(inView view: UIView) + func detachLocalVideoPreview(inView view: UIView) } protocol ManageCallInProgressParticipantsProtocol: class { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 5984f868a..4bd053316 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -144,7 +144,7 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func switchCamera() { - vox.switchCamera() + NynjaCommunicatorService.sharedInstance.switchCamera() } // MARK: - VoxServiceDelegate @@ -215,7 +215,7 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func didStopLocalCapturerForCall(call: NYNCall) { - + self.presenter.didStopLocalCapturer() } func addRemoteVideoRenderer(inView view: UIView) { @@ -225,7 +225,11 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic func attachLocalVideoPreview(inView view: UIView) { NynjaCommunicatorService.sharedInstance.attachLocalVideoPreview(inView: view) } - + + func detachLocalVideoPreview(inView view: UIView) { + NynjaCommunicatorService.sharedInstance.detachLocalVideoPreview(inView: view) + } + func stopTimer () { if timer != nil { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 63a19999c..0ca366925 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -116,6 +116,10 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn self.view.didStartLocalCapturer() } + func didStopLocalCapturer() { + self.view.didStopLocalCapturer() + } + func addRemoteVideoRenderer(inView view: UIView) { self.interactor.addRemoteVideoRenderer(inView: view) } @@ -124,6 +128,10 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn self.interactor.attachLocalVideoPreview(inView: view) } + func dettachLocalVideoPreview(inView view: UIView) { + self.interactor.detachLocalVideoPreview(inView: view) + } + func remoteVideoStreamStopped() { //self.view.remoteVideoStreamStopped() self.view.setupUI() diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 78420d3d2..dd100d8ca 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -112,7 +112,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa let view = UIView() view.isUserInteractionEnabled = true - view.backgroundColor = .yellow + view.backgroundColor = self.view.backgroundColor self.view.addSubview(view) view.snp.makeConstraints({ (make) in @@ -126,14 +126,14 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa let view = UIView() view.isUserInteractionEnabled = true - view.backgroundColor = .green + view.backgroundColor = .clear self.view.addSubview(view) view.snp.makeConstraints({ (make) in make.left.equalTo(self.view).offset(1.5*offset) make.bottom.equalTo(self.otherVideoView.snp.bottom).offset(-1.5*offset) - make.width.equalTo(30) - make.height.equalTo(60) + make.width.equalTo(72.adjustedByWidth) + make.height.equalTo(115.adjustedByHeight) }) return view }() @@ -145,7 +145,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa btn.backgroundColor = .clear btn.setImage(img, for: .normal) self.view.addSubview(btn) - btn.addTarget(self, action: #selector(declineButtonPressed), for: .touchUpInside) + btn.addTarget(self, action: #selector(switchCameraButtonPressed), for: .touchUpInside) btn.snp.makeConstraints({ (make) in make.right.equalTo(self.view).offset(-offset) @@ -795,7 +795,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa // } } - func switchCameraButtonPressed() { + @objc func switchCameraButtonPressed() { presenter.switchCamera() } @@ -923,4 +923,8 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func didStartLocalCapturer() { self.presenter.attachLocalVideoPreview(inView: self.myVideoView); } + + func didStopLocalCapturer() { + self.presenter.dettachLocalVideoPreview(inView: self.myVideoView); + } } diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index 1f5c6b9f7..73f3a4c9d 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -276,6 +276,18 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele call.attachLocalPreview(to: view) } } + + func detachLocalVideoPreview(inView view: UIView) { + if let call = self.call { + call.detachLocalPreview(from: view) + } + } + + func switchCamera() { + if let call = self.call { + call.switchCamera() + } + } //MARK: Helpers diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index 31c612f1d..3afe3d5bd 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit 31c612f1dfc860cdb6e06e1e3fc5be8a86a5c78e +Subproject commit 3afe3d5bd094d8119c1e80fa3aabe673ab8b7543 -- GitLab From f4bd9aee80a8245f86efcefc07cf2877f6a314fd Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Fri, 3 Aug 2018 16:03:52 +0300 Subject: [PATCH 11/27] polishing video views --- .../View/CallInProgressViewController.swift | 34 +++++++++++++++---- Nynja/Resources/en.lproj/Localizable.strings | 1 + Nynja/Resources/ru.lproj/Localizable.strings | 1 + 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index dd100d8ca..df02f38aa 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -562,12 +562,13 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.backgroundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) case .oneToOneVideo: self.collectionView.isHidden = true - self.myVideoView.isHidden = false - self.otherVideoView.isHidden = false self.switchCameraButton.isHidden = false - self.backgroundImage.isHidden = true - self.view.insertSubview(self.myVideoView, aboveSubview:otherVideoView) - self.view.insertSubview(self.switchCameraButton, aboveSubview:otherVideoView) + self.myVideoView.isHidden = true + self.otherVideoView.isHidden = true + self.view.sendSubview(toBack: otherVideoView) + self.view.sendSubview(toBack: myVideoView) + self.backgroundImage.isHidden = false + self.backgroundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) case .groupAudio: self.collectionView.isHidden = false self.myVideoView.isHidden = true @@ -800,8 +801,12 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa } func updateTime(text: String) { - statusLabel.text = "voice_call_status".localized + " - \(text)" - //bottomView.timerLabel.text = text + + if .oneToOneVideo == self.callInProgressMode { + statusLabel.text = "video_call_status".localized + " - \(text)" + } else { + statusLabel.text = "voice_call_status".localized + " - \(text)" + } } func changeUIToIncall() { @@ -917,14 +922,29 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa } func didAddRemoteVideoStream() { + + self.otherVideoView.isHidden = false + self.view.bringSubview(toFront: self.otherVideoView) + self.backgroundImage.isHidden = true + self.backgroundImage.image = nil + self.view.sendSubview(toBack: self.backgroundImage) + self.presenter.addRemoteVideoRenderer(inView: self.otherVideoView); } func didStartLocalCapturer() { + + self.myVideoView.isHidden = false + self.view.bringSubview(toFront: self.myVideoView) + self.presenter.attachLocalVideoPreview(inView: self.myVideoView); } func didStopLocalCapturer() { + + self.myVideoView.isHidden = true + self.view.sendSubview(toBack: self.myVideoView) + self.presenter.dettachLocalVideoPreview(inView: self.myVideoView); } } diff --git a/Nynja/Resources/en.lproj/Localizable.strings b/Nynja/Resources/en.lproj/Localizable.strings index 58852e48b..744a05c56 100644 --- a/Nynja/Resources/en.lproj/Localizable.strings +++ b/Nynja/Resources/en.lproj/Localizable.strings @@ -594,6 +594,7 @@ // MARK: Call "voice_call_status"="Voice Call"; +"video_call_status"="Video Call"; "voice_call_the_feature_currently_unavailable"="This feature is currently unavailable"; // MARK: Settings group diff --git a/Nynja/Resources/ru.lproj/Localizable.strings b/Nynja/Resources/ru.lproj/Localizable.strings index c9f15074c..be90e72cc 100644 --- a/Nynja/Resources/ru.lproj/Localizable.strings +++ b/Nynja/Resources/ru.lproj/Localizable.strings @@ -555,6 +555,7 @@ // MARK: Call "voice_call_status"="Телефонный звонок"; +"video_call_status"="Видео звонок"; "voice_call_the_feature_currently_unavailable"="Эта функция в данный момент недоступна"; // MARK: Settings group -- GitLab From 241255e0a583ef952847fa24b04a1791ad508518 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Mon, 6 Aug 2018 15:38:56 +0300 Subject: [PATCH 12/27] Polishing video stream visibility --- .../View/CallInProgressViewController.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index df02f38aa..e5edf6a56 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -518,7 +518,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa return button }() - func updateModeVisibility() { + func setupVisibility() { self.nameLabel.isHidden = false @@ -564,7 +564,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.collectionView.isHidden = true self.switchCameraButton.isHidden = false self.myVideoView.isHidden = true - self.otherVideoView.isHidden = true + self.otherVideoView.isHidden = false self.view.sendSubview(toBack: otherVideoView) self.view.sendSubview(toBack: myVideoView) self.backgroundImage.isHidden = false @@ -604,7 +604,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func setupUI() { - updateModeVisibility() updateTitle() } @@ -649,7 +648,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.view.backgroundColor = Constants.colors.grayForCallScreenTop.getColor() self.presenter.willShow() - + setupVisibility() } //MARK: Collection View Delegates @@ -935,7 +934,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func didStartLocalCapturer() { self.myVideoView.isHidden = false - self.view.bringSubview(toFront: self.myVideoView) + self.view.insertSubview(self.myVideoView, aboveSubview: self.otherVideoView) self.presenter.attachLocalVideoPreview(inView: self.myVideoView); } -- GitLab From ae86a0fad52b65b90d238290dea01b769a6b509c Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Mon, 6 Aug 2018 19:23:07 +0300 Subject: [PATCH 13/27] Polishing Z order --- .../View/CallInProgressViewController.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index e5edf6a56..47fa2854d 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -145,6 +145,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa btn.backgroundColor = .clear btn.setImage(img, for: .normal) self.view.addSubview(btn) + btn.addTarget(self, action: #selector(switchCameraButtonPressed), for: .touchUpInside) btn.snp.makeConstraints({ (make) in @@ -562,7 +563,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.backgroundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) case .oneToOneVideo: self.collectionView.isHidden = true - self.switchCameraButton.isHidden = false + self.switchCameraButton.isHidden = true self.myVideoView.isHidden = true self.otherVideoView.isHidden = false self.view.sendSubview(toBack: otherVideoView) @@ -923,12 +924,17 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func didAddRemoteVideoStream() { self.otherVideoView.isHidden = false + self.switchCameraButton.isHidden = false self.view.bringSubview(toFront: self.otherVideoView) + self.view.insertSubview(self.switchCameraButton, aboveSubview: self.otherVideoView) self.backgroundImage.isHidden = true self.backgroundImage.image = nil self.view.sendSubview(toBack: self.backgroundImage) - + self.presenter.addRemoteVideoRenderer(inView: self.otherVideoView); + + self.view.bringSubview(toFront: self.nameLabel) + self.view.bringSubview(toFront: self.statusLabel) } func didStartLocalCapturer() { @@ -937,6 +943,9 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.view.insertSubview(self.myVideoView, aboveSubview: self.otherVideoView) self.presenter.attachLocalVideoPreview(inView: self.myVideoView); + + self.view.bringSubview(toFront: self.nameLabel) + self.view.bringSubview(toFront: self.statusLabel) } func didStopLocalCapturer() { -- GitLab From 185fb1a3a14f3a30e476159aaa8202d71cb43dbb Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Tue, 7 Aug 2018 10:58:30 +0300 Subject: [PATCH 14/27] Update externals --- externals/mobile-sdk-s4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index 3afe3d5bd..b70ad6c68 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit 3afe3d5bd094d8119c1e80fa3aabe673ab8b7543 +Subproject commit b70ad6c6855c212b343c98b10bc82d3ff09a740f -- GitLab From fb1e2d0f6abd4c32532224fe63bdcc240d4881e7 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 09:29:35 +0300 Subject: [PATCH 15/27] Removed unneeded Call VIPER --- Nynja/Modules/Call/CallProtocols.swift | 118 ---- .../Call/Interactor/CallInteractor.swift | 305 -------- .../Call/Presenter/CallPresenter.swift | 170 ----- .../Call/View/CallViewController.swift | 655 ------------------ .../Call/WireFrame/CallWireframe.swift | 190 ----- Nynja/Modules/Main/MainProtocols.swift | 4 - .../Main/Presenter/MainPresenter.swift | 21 - .../Main/WireFrame/MainWireframe.swift | 55 +- 8 files changed, 1 insertion(+), 1517 deletions(-) delete mode 100644 Nynja/Modules/Call/CallProtocols.swift delete mode 100644 Nynja/Modules/Call/Interactor/CallInteractor.swift delete mode 100644 Nynja/Modules/Call/Presenter/CallPresenter.swift delete mode 100644 Nynja/Modules/Call/View/CallViewController.swift delete mode 100644 Nynja/Modules/Call/WireFrame/CallWireframe.swift diff --git a/Nynja/Modules/Call/CallProtocols.swift b/Nynja/Modules/Call/CallProtocols.swift deleted file mode 100644 index df276ca62..000000000 --- a/Nynja/Modules/Call/CallProtocols.swift +++ /dev/null @@ -1,118 +0,0 @@ -// -// CallCallProtocols.swift -// Nynja -// -// Created by Bohdan Paliychuk on 26/07/2017. -// Copyright © 2017 TecSynt Solutions. All rights reserved. -// - -import UIKit -import VoxImplant - -protocol CallWireFrameProtocol: class { - - func presentCall(navigation: UINavigationController, callMode: CallMode, contact: Contact, call: VICall?, main: MainWireFrame?) - - /** - * Add here your methods for communication PRESENTER -> WIREFRAME - */ - func messageAction(isVideo: Bool, contact: Contact) - func messageActionWith(room:Room, isVideo: Bool) - func updateCallParticipants() - func showMenuWith(participant: NYNCallParticipant?, delegate: ManageCallParticipantsProtocol) -} - -protocol CallViewProtocol: class { - - var presenter: CallPresenterProtocol! { get set } - - /** - * Add here your methods for communication PRESENTER -> VIEW - */ - func setupUI() - func updateTime(text: String) - func remoteVideoStreamStopped() - func changeUIToIncall() - func update(participants: [NYNCallParticipant]) - func updateCallBy(status: CallStatus) - func callFailed() -} - -protocol CallPresenterProtocol: class { - - var view: CallViewProtocol! { get set } - var interactor: CallInteractorInputProtocol! { get set } - var wireFrame: CallWireFrameProtocol! { get set } - var contact: Contact? { get set } - var room: Room? { get set } - var type: CallMode! { get set } - /** - * Add here your methods for communication VIEW -> PRESENTER - */ - - func willShow() - func setupViews(myView: UIView, remoteView: UIView) - - func acceptCall(withVideo: Bool) - func declineCall() - func speakerAction() - func messageAcion(with roomId:String, isVideo: Bool) - func microphoneAction() - func toggleMicrophone() - func isMuted()->Bool - func switchCamera() - func disableVideo() - func viewShowed() - func rejectCall() - func updateCallParticipants() - func showMenuWith(groupCollectionCell: GroupCollectionViewCell) - func endCall() -} - -protocol CallInteractorOutputProtocol: class { - - /** - * Add here your methods for communication INTERACTOR -> PRESENTER - */ - - func callClosed() - func callConnected(withVideo: Bool) - func setRingingWithoutVideo() - func setRingingStatus() - func remoteVideoStreamStopped() - func updateTime(text: String) - func update(participants: [NYNCallParticipant]) - func callFailed() -} - -protocol CallInteractorInputProtocol: class { - - var presenter: CallInteractorOutputProtocol! { get set } - var call: VICall? { get set } - var contact: Contact? { get } - - /** - * Add here your methods for communication PRESENTER -> INTERACTOR - */ - - func acceptCall(withVideo: Bool) - func declineCall() - func speakerAction() - func microphoneAction() - func toggleMicrophone() - func isMuted()->Bool - func switchCamera() - func setupViews(myView: UIView, remoteView: UIView) - func disableVideo() - func setupDelegate() - func rejectCall() - func updateGroupCall(contacts: [Contact]) - func removeCallMember(memberId: String) - func endCall() -} - -protocol ManageCallParticipantsProtocol: class { - func remove(participant: NYNCallParticipant?) - func mute(participant: NYNCallParticipant?) - func unmute(participant: NYNCallParticipant?) -} diff --git a/Nynja/Modules/Call/Interactor/CallInteractor.swift b/Nynja/Modules/Call/Interactor/CallInteractor.swift deleted file mode 100644 index 994256e68..000000000 --- a/Nynja/Modules/Call/Interactor/CallInteractor.swift +++ /dev/null @@ -1,305 +0,0 @@ -// -// CallCallInteractor.swift -// Nynja -// -// Created by Bohdan Paliychuk on 26/07/2017. -// Copyright © 2017 TecSynt Solutions. All rights reserved. -// -import VoxImplant - -class CallInteractor: CallInteractorInputProtocol, VoxServiceDelegate, NynjaCommunicatorServiceDelegate { - - weak var presenter: CallInteractorOutputProtocol! - weak var call: VICall? - - var vox = VoxService.sharedInstance - var timer: Timer? - - var contact: Contact? { - guard let voxId = call?.voxId else { return nil } - return ContactDAO.findContactBy(voxId: voxId) - } - weak var nynCall: NYNCall? - - var duration = 0 - - - func setupDelegate() { - vox.delegate = self - NynjaCommunicatorService.sharedInstance.delegate = self - } - - func acceptCall(withVideo: Bool) { - if let id = call { - vox.answer(call: id, withVideo: withVideo) - } else if let ncall = self.nynCall { - NynjaCommunicatorService.sharedInstance.acceptConference(call: ncall) - } - } - - func rejectCall() { - - if let nc = self.nynCall { - NynjaCommunicatorService.sharedInstance.rejectConference(call: nc) - - self.presenter.callClosed() - } - } - - func declineCall() { - if let id = call { - vox.cancelCall(call: id) - } else if let nc = self.nynCall { - if nc.callState == NYNCallState.connected { - nc.hangup() - } else { - self.presenter.callClosed() - } - } else { - self.presenter.callClosed() - } - } - - func speakerAction() { - vox.switchSpeaker() - } - - func disableVideo() { - if let id = call { - vox.disableVideo(call: id) - if id.duration() > 0 { - self.presenter.callConnected(withVideo: false) - } else { - self.presenter.setRingingWithoutVideo() - } - vox.withVideo = false - } - } - - func startRinging() { - presenter.setRingingStatus() - } - - func microphoneAction() { - if let id = call { - vox.switchMicrophone(call: id) - } - if let nc = self.nynCall { - nc.toggleMicrophone() - } - } - - func toggleMicrophone() { - - if let nc = self.nynCall { - nc.toggleMicrophone() - } - } - - func isMuted()->Bool { - - var muted:Bool = false - - if let nc = self.nynCall { - muted = nc.isMuted - } - - return muted - } - - func switchCamera() { - vox.switchCamera() - } - - // MARK: - VoxServiceDelegate - func remoteVideoStreamDeleted () { - presenter.remoteVideoStreamStopped() - } - - func callClosed(call: VICall, isError: Bool) { - self.presenter.callClosed() - } - - func callConnected(call: VICall,withVideo: Bool) { - self.presenter.callConnected(withVideo: withVideo) - self.startTimer() - } - - func setupViews(myView: UIView, remoteView: UIView) { - vox.remoteView = remoteView - vox.myView = myView - } - - func startTimer() { - timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(runTimedCode), userInfo: nil, repeats: true) - } - - @objc func runTimedCode() { - if let call = self.call { - let durationInt = Int(call.duration()) - let minutes = durationInt / 60 - let seconds = durationInt % 60 - - let text = String.localizedStringWithFormat("%u:%02u", minutes,seconds) - if self.presenter != nil { - self.presenter.updateTime(text:text) - } - } else if nil != self.nynCall { - - duration += 1 - let durationInt = Int(duration) - let minutes = durationInt / 60 - let seconds = durationInt % 60 - - let text = String.localizedStringWithFormat("%u:%02u", minutes,seconds) - if self.presenter != nil { - self.presenter.updateTime(text:text) - } - } - } - - func dialing(call: NYNCall) { - - } - - func incomingCallRinging(call: NYNCall) { - - } - - func creatingGroupCall(name: String, call: NYNCall) { - - } - - func stopTimer () { - - if timer != nil { - timer?.invalidate() - timer = nil - duration = 0 - } - } - - func callEnded(call: NYNCall, isError: Bool) { - self.presenter.callClosed() - - stopTimer() - } - - func readyToStart(call:NYNCall) { - - call.start() - - } - - func stateDidChange(call: NYNCall, state: NYNCallState) { - - if let ncall = self.nynCall { - if ncall.callId.elementsEqual(call.callId) { - switch state { - case NYNCallState.new: - break - case NYNCallState.readyToStart: - self.readyToStart(call: ncall) - break; - case NYNCallState.establishing: - break - case NYNCallState.connecting: - break - case NYNCallState.connected: - self.presenter.callConnected(withVideo: false) - self.startTimer() - break - case NYNCallState.failed: - self.presenter.callFailed() - break - case NYNCallState.disconnected: - break - case NYNCallState.closed: - break - case NYNCallState.count: - break - } - } - } - } - - func participantsUpdated(call: NYNCall) { - - if let ncall = self.nynCall, call.callId.elementsEqual(ncall.callId) { - self.presenter.update(participants: ncall.participants) - } - } - - func updateGroupCall(contacts: [Contact]) { - - if let ncall = self.nynCall { - - for ctc in contacts { - let name = "\(ctc.names ?? "") \(ctc.surnames ?? "")" - - NynjaCommunicatorService.sharedInstance.addConferenceMember(conferenceId: ncall.callId, phoneId: ctc.phone_id!, name: name) - } - } - } - - func removeCallMember(memberId: String) { - if let ncall = self.nynCall { - NynjaCommunicatorService.sharedInstance.removeConferenceMember(conferenceId: ncall.callId, memberId: memberId) - } - } - - func endCall() { - if let nc = self.nynCall { - nc.end() - } - } - - //MARK: Should remove to serverside - - let storageService: StorageService = .sharedInstance - let payloadBuilder: MessagePayloadBuilderInput = MessagePayloadBuilder() - private let mqttService: MQTTService = .sharedInstance - let processingManager = DefaultMessagesProcessingManager.shared - - private(set) lazy var messageFactory: MessageFactoryProtocol = { - let factory = MessageFactory() - - let dependencies = MessageFactory.Dependencies( - storageService: storageService, - payloadBuilder: payloadBuilder - ) - factory.inject(dependencies: dependencies) - - return factory - }() - - private(set) lazy var messageSendingService: MessageSendingServiceProtocol = { - let service = MessageSendingService() - let dependencies = MessageSendingService.Dependencies( - mqttService: mqttService, - storageService: storageService, - processingManager: processingManager - ) - service.inject(dependencies: dependencies) - - return service - }() - - func conferenceCreated(call: NYNCall) { - sendCall(ncall: call) - } - - func didAddVideoStreamForCall(call: NYNCall) { - - } - - - func sendCall(ncall: NYNCall) { - let room = Room() - room.id = ncall.externalInfo - let membersIds = ncall.participants.map({ $0.address ?? "" }) - let message = messageFactory.makeCallMessage(members: membersIds, room: room) - try? storageService.perform(action: .save, with: message) - messageSendingService.sendMessage(message) - } -} diff --git a/Nynja/Modules/Call/Presenter/CallPresenter.swift b/Nynja/Modules/Call/Presenter/CallPresenter.swift deleted file mode 100644 index 546b0c7d7..000000000 --- a/Nynja/Modules/Call/Presenter/CallPresenter.swift +++ /dev/null @@ -1,170 +0,0 @@ -// -// CallCallPresenter.swift -// Nynja -// -// Created by Bohdan Paliychuk on 26/07/2017. -// Copyright © 2017 TecSynt Solutions. All rights reserved. -// - -class CallPresenter: CallPresenterProtocol, CallInteractorOutputProtocol, EditParticipantsDelegate, ManageCallParticipantsProtocol { - - weak var view: CallViewProtocol! - var interactor: CallInteractorInputProtocol! - var wireFrame: CallWireFrameProtocol! - var contact: Contact? - var type: CallMode! - var room: Room? - - func acceptCall(withVideo: Bool) { - interactor.acceptCall(withVideo: withVideo) - } - - func disableVideo() { - interactor.disableVideo() - } - - func declineCall() { - interactor.declineCall() - } - - func rejectCall() { - interactor.rejectCall(); - } - - func updateCallParticipants() { - - wireFrame.updateCallParticipants() - } - - func showMenuWith(groupCollectionCell: GroupCollectionViewCell) { - - wireFrame.showMenuWith(participant: groupCollectionCell.callPart, delegate: self) - } - - func endCall() { - interactor.endCall() - } - - func speakerAction() { - interactor.speakerAction() - } - - func messageAcion(with roomId:String, isVideo: Bool) { - guard let room = RoomDAO.findRoom(by: roomId) else {return} - wireFrame.messageActionWith(room:room, isVideo:isVideo) - } - - func microphoneAction() { - interactor.microphoneAction() - } - - func toggleMicrophone() { - - interactor.toggleMicrophone() - } - - func isMuted()->Bool { - - return interactor.isMuted() - } - - func switchCamera() { - interactor.switchCamera() - } - - func callClosed() { - if let navigation = (self.view as? UIViewController)?.navigationController { - (navigation.parent as? MainViewProtocol)?.presenter.wireFrame.hideReturnToCallView() - navigation.popViewController(animated: true) - } - } - - func callConnected(withVideo: Bool) { - if withVideo { - self.view.setupUI() - } else { - self.view.setupUI() - } - - self.view.updateCallBy(status:.callInProgress) - } - - func callFailed() { - - self.view.callFailed() - } - - func remoteVideoStreamStopped() { - //self.view.remoteVideoStreamStopped() - self.view.setupUI() - self.view.updateCallBy(status:.callInProgress) - } - - - func setRingingWithoutVideo() { - self.view.setupUI() - self.view.updateCallBy(status:.callStarting) - } - - func setRingingStatus() { - self.view.setupUI() - self.view.updateCallBy(status:.callOutgoingAudio) - } - - func willShow() { - self.view.setupUI() - } - - func setupViews(myView: UIView, remoteView: UIView) { - self.interactor.setupViews(myView: myView, remoteView: remoteView) - } - - func updateTime(text: String) { - self.view.updateTime(text: text) - } - - func update(participants: [NYNCallParticipant]) { - - self.view.update(participants: participants) - } - - func viewShowed() { - self.interactor.setupDelegate() - } - - // MARK: EditParticpantsDelegate - - func updateGroupCall(contacts: [Contact]) { - - self.interactor.updateGroupCall(contacts:contacts) - } - - func participantsUpdated(contacts: [Contact]) { - - } - - func participantsUpdated(result: ParticipantsResult){ - - switch result { - case let .updateGroupCall(contacts): - updateGroupCall(contacts: contacts) - LogService.log(topic: .callSystem, text: "updateGroupCall") - default: - break - } - } - - // MARK: ManageCallParticipantsProtocol - func remove(participant: NYNCallParticipant?) { - interactor.removeCallMember(memberId: (participant?.memberId)!) - } - - func mute(participant: NYNCallParticipant?) { - - } - - func unmute(participant: NYNCallParticipant?) { - - } - -} diff --git a/Nynja/Modules/Call/View/CallViewController.swift b/Nynja/Modules/Call/View/CallViewController.swift deleted file mode 100644 index 55e62a488..000000000 --- a/Nynja/Modules/Call/View/CallViewController.swift +++ /dev/null @@ -1,655 +0,0 @@ -// -// CallCallViewController.swift -// Nynja -// -// Created by Bohdan Paliychuk on 26/07/2017. -// Copyright © 2017 TecSynt Solutions. All rights reserved. -// - -enum CallMode { - case incamingCall - case incamingGroupCall - case outGoingCall - case outGoingGroupCall - case incamingVideoCall - case incamingVideoGroupCall - case outGoingVideoCall - case outGoingVideoGroupCall -} - -enum CallStatus { - case callStarting - case callIncomingAudio - case callIncomingVideo - case callOutgoingAudio - case callOutgoingVideo - case callConnecting - case callInProgress -} - -import UIKit - -class CallViewController: BaseVC, CallViewProtocol, BottomCallViewProtocol, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, GroupCollectionViewCellDelegate, GroupAddParticipantsCollectionViewCellDelegate { - - - var presenter: CallPresenterProtocol! - var contact: Contact? - var callMode: CallMode! - var callStatus: CallStatus! - var dataSource: NSMutableArray = [] - var moderator: Bool = false - var roomId: String = "" - - let bottomViewHeight: Float = 200.0 - let labelNameHeight: Float = 40.0 - let labelStatusHeight: Float = 30.0 - let offset: Float = 10.0 - let middleGVHeight: Float = 100.0 - let statusBarHeight: Float = Float(UIApplication.shared.statusBarFrame.size.height) - - lazy var expectedRowsInCollectionView: Int = { - - var sections:Int = 0 - - //Check which iPhone it is - let screenHeight:Float = Float(UIScreen.main.bounds.size.height) - - let clearSpace:Float = screenHeight - (bottomViewHeight + labelNameHeight + labelStatusHeight + statusBarHeight + 5*offset/*top offset + vertical spacing controlls offset*/) - - if 0 > clearSpace { - - sections = 3 - - } else { - - let minSectionHeight:Float = 83.0 - - sections = Int(floor(clearSpace/minSectionHeight)) - } - - return sections - }() - - lazy var contentView: UIView = { - let content = UIView() - - if (self.callMode == .outGoingGroupCall || self.callMode == .outGoingVideoGroupCall || self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall) { - content.backgroundColor = Constants.colors.grayForCallScreenBottom.getColor() - } else { - content.backgroundColor = .clear - } - - self.view.addSubview(content) - content.snp.makeConstraints({ (make) in - make.top.left.right.bottom.equalTo(self.view) - }) - - return content - }() - - lazy var backgtoundImage: UIImageView = { - - let img = UIImageView() - img.isUserInteractionEnabled = true - img.contentMode = .scaleAspectFill - let height = UIScreen.main.bounds.height * 0.6 - self.contentView.addSubview(img) - - img.snp.makeConstraints({ (make) in - make.top.left.right.equalTo(self.view) - make.bottom.equalTo(self.bottomView).offset(-bottomViewHeight) - }) - return img - }() - - lazy var collectionView: UICollectionView = { - let layout = UICollectionViewFlowLayout() - layout.scrollDirection = .vertical - layout.minimumLineSpacing = 0 - layout.minimumInteritemSpacing = 0 - let cv = GroupCollectionView(frame: .zero, collectionViewLayout: layout) - cv.isUserInteractionEnabled = true - self.contentView.addSubview(cv) - cv.delegate = self - cv.dataSource = self - cv.backgroundColor = Constants.colors.grayForCallScreenBottom.getColor() - cv.register(GroupCollectionViewCell.self, forCellWithReuseIdentifier: String(describing: GroupCollectionViewCell.self)) - cv.register(GroupAddParticipantsCollectionViewCell.self, forCellWithReuseIdentifier: String(describing: GroupAddParticipantsCollectionViewCell.self)) - - cv.snp.makeConstraints({ (make) in - make.top.equalTo(self.statusLabel.snp.bottom).offset(offset) - make.left.right.equalTo(self.contentView) - make.bottom.equalTo(self.bottomView.snp.top) - - }) - return cv - }() - - private lazy var nameLabel: UILabel = { - let scwidth = UIScreen.main.bounds.width - let lbl = UILabel() - lbl.textAlignment = .center - lbl.font = UIFont(name: Constants.fonts.medium, size: 22.0) - lbl.textColor = Constants.colors.white.getColor() - lbl.numberOfLines = 1 -// lbl.adjustsFontSizeToFitWidth = true - lbl.baselineAdjustment = .alignCenters - lbl.lineBreakMode = .byTruncatingTail - self.contentView.addSubview(lbl) - - if (self.callMode == .outGoingGroupCall || self.callMode == .outGoingVideoGroupCall || self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall) { - - lbl.snp.makeConstraints({ (make) in - make.top.equalTo(self.view).offset(3*offset) - make.centerX.equalTo(self.view) - make.height.equalTo(labelNameHeight) - }) - - } else { - - lbl.snp.makeConstraints({ (make) in - make.centerX.equalTo(self.view) - make.centerY.equalTo(self.view) - make.height.equalTo(40.0) - }) - } - - return lbl - }() - - private lazy var statusLabel: UILabel = { - let scwidth = UIScreen.main.bounds.width - let lbl = UILabel() - lbl.textAlignment = .center - lbl.font = UIFont(name: Constants.fonts.regular, size: 16.0) - lbl.textColor = Constants.colors.white.getColor() - lbl.backgroundColor = .clear - lbl.numberOfLines = 1 - lbl.adjustsFontSizeToFitWidth = true - lbl.baselineAdjustment = .alignCenters - lbl.lineBreakMode = .byClipping - self.contentView.addSubview(lbl) - - lbl.snp.makeConstraints({ (make) in - make.top.equalTo(self.nameLabel.snp.bottom).offset(offset) - make.left.right.equalTo(self.contentView) - make.height.equalTo(labelStatusHeight) - }) - - return lbl - }() - - - lazy var bottomView : BottomCallView = { - let lv = BottomCallView() - lv.backgroundColor = Constants.colors.grayForCallScreenBottom.getColor() - lv.delegate = self - let height = bottomViewHeight//UIScreen.main.bounds.width / 1.4 - - self.contentView.addSubview(lv) - lv.snp.makeConstraints({ (make) in - make.left.right.equalTo(self.contentView) - make.bottom.equalTo(self.contentView) - make.height.equalTo(height) - }) - - return lv - }() - - lazy var resizeVideoViewsButton : UIButton = { - let btn = UIButton() - let img = #imageLiteral(resourceName: "minimaze") - btn.setBackgroundImage(img, for: .normal) - let width = UIScreen.main.bounds.width * 0.088 - let height = UIScreen.main.bounds.width * 0.09 - btn.layer.masksToBounds = true - self.contentView.addSubview(btn) - let topPadding = UIScreen.main.bounds.width * 0.078 - let leftPadding = UIScreen.main.bounds.width * 0.037 - btn.addTarget(self, action: #selector(resizeButtonAction), for: .touchUpInside) - - btn.snp.makeConstraints({ (make) in - make.width.equalTo(width) - make.height.equalTo(height) - make.left.equalTo(self.contentView.snp.left).offset(leftPadding) - make.top.equalTo(self.contentView).offset(topPadding) - }) - return btn - }() - - lazy var yourVideoView: UIView = { - let content = UIView() - content.backgroundColor = .clear - self.contentVideoView.addSubview(content) - - let width = UIScreen.main.bounds.width * 0.256 - let height = UIScreen.main.bounds.width * 0.45 - let topPadding = UIScreen.main.bounds.width * 0.063 - let rightPadding = UIScreen.main.bounds.width * 0.016 - - content.snp.makeConstraints({ (make) in - make.width.equalTo(width) - make.height.equalTo(height) - make.right.equalTo(self.contentVideoView).offset(-rightPadding) - make.top.equalTo(self.contentVideoView).offset(topPadding) - }) - - return content - }() - - lazy var partnerVideoView: UIView = { - let content = UIView() - content.backgroundColor = .clear - self.contentVideoView.addSubview(content) - content.snp.makeConstraints({ (make) in - make.top.left.right.bottom.equalTo(self.contentVideoView) - }) - - return content - }() - - lazy var contentVideoView: UIView = { - let content = UIView() - content.backgroundColor = .clear - self.view.addSubview(content) - content.snp.makeConstraints({ (make) in - make.top.left.right.bottom.equalTo(self.view) - }) - - return content - }() - - lazy var backgtoundVideoImage: UIImageView = { - let img = UIImageView() - img.isUserInteractionEnabled = true - img.contentMode = .scaleAspectFit - self.contentVideoView.addSubview(img) - - img.snp.makeConstraints({ (make) in - make.top.left.right.bottom.equalTo(self.contentVideoView) - }) - return img - }() - - lazy var middleGradientView: GradientView = { - let view = GradientView(colors: [Constants.colors.grayForCallScreenTop.getColor(withAlpha: 0), Constants.colors.grayForCallScreenBottom.getColor()]) - self.bottomView.addSubview(view) - - view.snp.makeConstraints({ (make) in - make.top.equalTo(self.bottomView).offset(-middleGVHeight) - make.trailing.equalTo(self.view) - make.leading.equalTo(self.view) - make.height.equalTo(middleGVHeight) - }) - - return view - }() - - func setupUI() { - - self.contentView.isHidden = false - backImage.isHidden = true - - if (self.callMode == .outGoingGroupCall || self.callMode == .outGoingVideoGroupCall || self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall) { - - self.middleGradientView.isHidden = true - self.backgtoundImage.isHidden = true - self.collectionView.isHidden = false - - } else { - - self.middleGradientView.isHidden = false - self.backgtoundImage.isHidden = false - self.collectionView.isHidden = true - - self.backgtoundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) - } - - self.middleGradientView.isHidden = false - - var viewTitle:String = "" - - if let ctct = self.contact { - viewTitle = "\(ctct.names ?? "") \(ctct.surnames ?? "")" - } - - viewTitle = "call_incoming_audio_conference".localized - - if self.callMode == .outGoingVideoGroupCall || self.callMode == .outGoingGroupCall { - if self.presenter != nil { - if let room = RoomDAO.findRoom(by: self.roomId) { - if let rn = room.name { - viewTitle = rn - } - } - } - } - - nameLabel.text = viewTitle - - self.bottomView.backgroundColor = Constants.colors.grayForCallScreenBottom.getColor() - contentVideoView.isHidden = true - partnerVideoView.isHidden = true - switch self.callMode! { - case .incamingCall, .incamingGroupCall: - statusLabel.text = "call_incoming".localized - case .outGoingCall, .outGoingVideoCall, .outGoingGroupCall, .outGoingVideoGroupCall: - statusLabel.text = "call_connecting".localized - case .incamingVideoCall, .incamingVideoGroupCall: - statusLabel.text = "call_incoming_video".localized - } - - bottomView.setupCallView(withMode: self.callMode) - self.presenter.setupViews(myView: yourVideoView, remoteView: partnerVideoView) - } - - func updateCallBy(status: CallStatus) { - - self.callStatus = status - - switch self.callStatus { - case .callStarting: - statusLabel.text = "call_connecting".localized - break - case .callIncomingAudio: - statusLabel.text = "call_incoming".localized - break - case .callIncomingVideo: - self.bottomView.inCallVideo() - self.middleGradientView.isHidden = true - bottomView.backgroundColor = .clear - let hidden:Bool = (self.callMode == .outGoingGroupCall || self.callMode == .outGoingVideoGroupCall || self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall) - backgtoundImage.isHidden = hidden - middleGradientView.isHidden = hidden - collectionView.isHidden = !hidden - statusLabel.isHidden = true - nameLabel.isHidden = true - resizeVideoViewsButton.isHidden = false - contentVideoView.isHidden = false - partnerVideoView.isHidden = false - contentView.bringSubview(toFront: yourVideoView) - self.view.bringSubview(toFront: contentView) - break - case .callOutgoingAudio: - statusLabel.text = "call_ringing".localized - self.bottomView.outGoingVideoCall() - break - case .callOutgoingVideo: - break - case .callConnecting: - break - case .callInProgress: - self.bottomView.inCall() - statusLabel.text = "voice_call_status".localized + " - 00:00" - let hidden:Bool = (self.callMode == .outGoingGroupCall || self.callMode == .outGoingVideoGroupCall || self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall) - backgtoundImage.isHidden = hidden - middleGradientView.isHidden = hidden - collectionView.isHidden = !hidden - statusLabel.isHidden = false - nameLabel.isHidden = false - resizeVideoViewsButton.isHidden = true - contentVideoView.isHidden = true - partnerVideoView.isHidden = true - break - - default: break - - } - } - - func callFailed() { - self.bottomView.callFailed() - - statusLabel.text = "call_failed".localized - backgtoundImage.isHidden = true - middleGradientView.isHidden = true - collectionView.isHidden = true - statusLabel.isHidden = false - nameLabel.isHidden = false - } - - func remoteVideoStreamStopped() { - - backgtoundVideoImage.isHidden = false - backgtoundVideoImage.image = backgtoundImage.image - - partnerVideoView.isHidden = true - self.contentVideoView.bringSubview(toFront: self.yourVideoView) - } - - - @objc func resizeButtonAction() { - presenter.messageAcion(with: roomId, isVideo: true) - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - // Note: need to prevent weird animation which appears when incoming/outcoming call appears. - self.view.layoutIfNeeded() - - self.presenter.viewShowed() - self.presenter.setupViews(myView: yourVideoView, remoteView: partnerVideoView) - - // Note: need to prevent weird animation with remote and local video views. - self.partnerVideoView.layoutIfNeeded() - self.yourVideoView.layoutIfNeeded() - } - - override func initialize() { - super.initialize() - - self.view.backgroundColor = Constants.colors.grayForCallScreenTop.getColor() - - self.presenter.willShow() - } - - //MARK: Collection View Delegates - public func numberOfSections(in collectionView: UICollectionView) -> Int { - - return 1 - } - - //2 - func collectionView(_ collectionView: UICollectionView, - numberOfItemsInSection section: Int) -> Int { - - var rows:Int = dataSource.count - - if rows > 0 { - rows = dataSource.count + 1 - } - - return rows - } - - //3 - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - - let cell:UICollectionViewCell? - - if 0 == indexPath.row { - - let cellPlus:GroupAddParticipantsCollectionViewCell = - collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: GroupAddParticipantsCollectionViewCell.self), for: indexPath) as! GroupAddParticipantsCollectionViewCell - - cellPlus.delegate = self - - cell = cellPlus - } else { - - let cellPart:GroupCollectionViewCell = - collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: GroupCollectionViewCell.self), for: indexPath) as! GroupCollectionViewCell - - let callPart:NYNCallParticipant? = dataSource[indexPath.row - 1] as? NYNCallParticipant - - if let cp = callPart { - - cellPart.callPart = cp - cellPart.canRemove = self.moderator - cellPart.delegate = self - cellPart.updateCell() - - } else { - LogService.log(topic: .callSystem, text: "Illegal cell") - } - - cell = cellPart - } - - return cell! - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - - let spacing : CGFloat = (collectionViewLayout as? UICollectionViewFlowLayout)?.minimumInteritemSpacing ?? 0.0 - let offsetIn:CGFloat = 5.0 - let cellHeight = floor((collectionView.bounds.size.height - ((CGFloat(expectedRowsInCollectionView) - 1)*spacing))/CGFloat(expectedRowsInCollectionView)) - let cellWidth = floor((0.75*(cellHeight - 3*offsetIn) + 2*offsetIn)) - - return CGSize(width: cellWidth, height: cellHeight) - } - - //MARK: Group Add Participants Collection View Cell delegates - - func didPressAddGroupCollectionCell(groupCollectionCell: GroupAddParticipantsCollectionViewCell) { - presenter.updateCallParticipants() - } - - //MARK: Group Collection View Cell delegates - - func showMenuWith(groupCollectionCell: GroupCollectionViewCell) { - presenter.showMenuWith(groupCollectionCell:groupCollectionCell) - } - - //MARK: bottom view delegate - - func acceptButtonPressed() { - presenter.acceptCall(withVideo: (self.callMode == .incamingVideoCall) || (self.callMode == .incamingVideoGroupCall)) - } - - func declineButtonPressed() { - - if self.callMode == .incamingVideoGroupCall || self.callMode == .incamingGroupCall { - if self.callStatus == .callInProgress { - if self.moderator { - askEndOrLeave() - } else { - presenter.declineCall() - } - } else { - presenter.rejectCall() - } - } else { - if self.moderator { - askEndOrLeave() - } else { - presenter.declineCall() - } - } - } - - func speakerButtonPressed() { - presenter.speakerAction() - } - - func messageButtonPressed() { - presenter.messageAcion(with: roomId, isVideo: false) - } - - func microphoneButtonPressed() { - presenter.microphoneAction() - } - - func toggleMicrophone() { - - presenter.toggleMicrophone() - } - - func isMuted()->Bool { - - return presenter.isMuted() - } - - func acceptAudioButtonPressed() { - if self.callMode == .incamingVideoCall || self.callMode == .incamingVideoGroupCall { - presenter.acceptCall(withVideo: false) - } else { - presenter.disableVideo() - } - } - - func switchCameraButtonPressed() { - presenter.switchCamera() - } - - func updateTime(text: String) { - statusLabel.text = "voice_call_status".localized + " - \(text)" - bottomView.timerLabel.text = text - } - - func changeUIToIncall() { - - self.updateCallBy(status: .callInProgress) - self.setupUI() - } - - func update(participants: [NYNCallParticipant]) { - - dataSource.removeAllObjects() - - for mem in participants { - - if let phoneId = mem.address { - - let contact:Contact? = ContactDAO.findContactBy(phoneId: phoneId) - - if let ct = contact { - - if let urlAvatar = ct.avatarUrl { - - mem.avatarUrl = urlAvatar.absoluteString - } - } - } - - dataSource.add(mem) - } - - collectionView.reloadData() - } - - func onCameraButtonPressed() { - - } - - func onMoreButtonPressed() { - - } - - func onPortOutButtonPressed() { - let alertVC = UIAlertController(title: "voice_call_the_feature_currently_unavailable".localized, message: nil, preferredStyle: .alert) - let okAction = UIAlertAction(title: "ok".localized, style: .cancel) { (action) in - alertVC.dismiss(animated: true, completion: nil) - } - alertVC.addAction(okAction) - - self.present(alertVC, animated: true, completion: nil) - } - - func askEndOrLeave() { - let alertVC = UIAlertController(title: "question_end_call".localized, message: nil, preferredStyle: .alert) - let forMeAction = UIAlertAction(title: "end_call_for_me".localized, style: .default) { (action) in - self.presenter.declineCall() - } - let forAllAction = UIAlertAction(title: "end_call_for_all".localized, style: .default) { (action) in - self.presenter.endCall() - } - - alertVC.addAction(forMeAction) - alertVC.addAction(forAllAction) - - self.present(alertVC, animated: true, completion: nil) - } - -} diff --git a/Nynja/Modules/Call/WireFrame/CallWireframe.swift b/Nynja/Modules/Call/WireFrame/CallWireframe.swift deleted file mode 100644 index 6de6c4e3b..000000000 --- a/Nynja/Modules/Call/WireFrame/CallWireframe.swift +++ /dev/null @@ -1,190 +0,0 @@ -// -// CallCallWireframe.swift -// Nynja -// -// Created by Bohdan Paliychuk on 26/07/2017. -// Copyright © 2017 TecSynt Solutions. All rights reserved. -// - -import UIKit -import VoxImplant - -class CallWireFrame: CallWireFrameProtocol { - - weak var navigation : UINavigationController? - weak var mainWF: MainWireFrame? - weak var call: VICall? - weak var view: CallViewProtocol! - weak var nynCall: NYNCall? - weak var external: EditParticipantsDelegate? - - func presentCall(navigation: UINavigationController, callMode: CallMode, contact: Contact, call: VICall? = nil, main: MainWireFrame?) { - - self.navigation = navigation - self.mainWF = main - - let view = CallViewController() - let presenter = CallPresenter() - let interactor = CallInteractor() - - interactor.call = call - - view.callMode = callMode - - self.view = view - main?.callVC = view - - presenter.type = callMode - presenter.contact = contact - - // Connecting - view.presenter = presenter - presenter.view = view - presenter.wireFrame = self - presenter.interactor = interactor - interactor.presenter = presenter - - navigation.pushViewController(view as UIViewController, animated: true) - } - - func presentDialInCall(navigation: UINavigationController, callMode: CallMode, call: NYNCall? = nil, main: MainWireFrame?) { - - let view = CallViewController() - let presenter = CallPresenter() - let interactor = CallInteractor() - interactor.nynCall = call - self.navigation = navigation - view.callMode = callMode - self.nynCall = call - self.view = view - self.mainWF = main - main?.callVC = view - - presenter.type = callMode - // Connecting - view.presenter = presenter - presenter.view = view - presenter.wireFrame = self - presenter.interactor = interactor - interactor.presenter = presenter - - navigation.pushViewController(view as UIViewController, animated: true) - } - - func presentCreateGroupCall(navigation: UINavigationController, callMode: CallMode, main: MainWireFrame?, call: NYNCall) { - - let view = CallViewController() - let presenter = CallPresenter() - let interactor = CallInteractor() - - self.external = presenter - - interactor.nynCall = call - self.navigation = navigation - view.callMode = callMode - view.moderator = call.isModerator - view.roomId = call.externalInfo - self.nynCall = call - self.view = view - self.mainWF = main - main?.callVC = view - - presenter.type = callMode - // Connecting - view.presenter = presenter - presenter.view = view - presenter.wireFrame = self - presenter.interactor = interactor - interactor.presenter = presenter - - navigation.pushViewController(view as UIViewController, animated: true) - } - - func messageActionWith(room: Room, isVideo: Bool) { - - if self.nynCall != nil { - self.navigation?.popViewController(animated: false) - self.navigation?.view.layoutIfNeeded() - (navigation?.viewControllers.last as? MainViewProtocol)?.presenter.showMessages(room: room, call: self.nynCall!, callVC: self.view!, isVideo: isVideo) - } - } - - func messageAction(isVideo: Bool, contact: Contact) { - self.navigation?.popViewController(animated: false) - self.navigation?.view.layoutIfNeeded() - (navigation?.viewControllers.last as? MainViewProtocol)?.presenter.showMessages(contact: contact, call: self.nynCall!, callVC: self.view!, isVideo: isVideo) - } - - func updateCallParticipants() { - - var members:[Member] = [] - var room:Room? - - if let nc = nynCall { - - for part in nc.participants { - - let member:Member = Member() - member.phone_id = part.address - members.append(member) - } - - if nc.externalInfo.count > 0 { - room = RoomDAO.findRoom(by: nc.externalInfo) - } - } - - AddParticipantsWireFrame().presentAddParticipants(navigation: navigation!, main: mainWF, selectedContacts: nil, delegate: external, mode: .updateGroupCall, members: members, room:room) - } - - func showMenuWith(participant: NYNCallParticipant?, delegate: ManageCallParticipantsProtocol) { - - let actionSheet = UIAlertController(title: nil, - message: nil, - preferredStyle: UIAlertControllerStyle.actionSheet) - - if (false == (participant?.isMe)!) { - actionSheet.addAction(UIAlertAction(title: "remove_participant_from_call".localized, - style: .default, - handler: { (action) in - delegate.remove(participant: participant) - })) - } - -// if participant.isMuted { -// actionSheet.addAction(UIAlertAction(title: "mute_call".localized, -// style: .default, -// handler: { (action) in -// delegate.mute(participant: participant) -// })) -// } else { -// actionSheet.addAction(UIAlertAction(title: "unmute".localized, -// style: .default, -// handler: { (action) in -// delegate.unmute(participant: participant) -// })) -// } - - actionSheet.addAction(UIAlertAction(title: "cancel".localized, style: .cancel, handler: { (action) in - - self.navigation?.dismiss(animated: true, completion: nil) - })) - - navigation?.present(actionSheet, animated: true, completion: nil) - } - - func removeParticipant(participant:NYNCallParticipant?) { - - } - - func muteParticipant(participant:NYNCallParticipant?) { - - - } - - func unmuteParticipant(participant:NYNCallParticipant?) { - - - } - -} diff --git a/Nynja/Modules/Main/MainProtocols.swift b/Nynja/Modules/Main/MainProtocols.swift index 2b10cc53c..7969d2cb4 100644 --- a/Nynja/Modules/Main/MainProtocols.swift +++ b/Nynja/Modules/Main/MainProtocols.swift @@ -58,9 +58,7 @@ protocol MainWireFrameProtocol: class { func getContact() -> String? func viewShowed() - func showMessages(contact: Contact, callVC: CallViewProtocol, isVideo: Bool) func showMessages(contact: Contact, callVC: CallInProgressViewProtocol, isVideo: Bool) - func showMessages(room: Room, callVC: CallViewProtocol, isVideo: Bool) func showMessages(room: Room, callVC: CallInProgressViewProtocol, isVideo: Bool) func showNotificationsSettings() func showWheelPositionPicker() @@ -165,8 +163,6 @@ protocol MainPresenterProtocol: class { func isActionEnabled() -> Bool func logout() func showLanguageSettings() - func showMessages(contact: Contact, call: NYNCall, callVC: CallViewProtocol, isVideo: Bool) - func showMessages(room: Room, call: NYNCall, callVC: CallViewProtocol, isVideo: Bool) func showMessages(contact: Contact, call: NYNCall, callVC: CallInProgressViewProtocol, isVideo: Bool) func showMessages(room: Room, call: NYNCall, callVC: CallInProgressViewProtocol, isVideo: Bool) diff --git a/Nynja/Modules/Main/Presenter/MainPresenter.swift b/Nynja/Modules/Main/Presenter/MainPresenter.swift index 8342dc0b9..b3d7a64e1 100644 --- a/Nynja/Modules/Main/Presenter/MainPresenter.swift +++ b/Nynja/Modules/Main/Presenter/MainPresenter.swift @@ -140,27 +140,6 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu self.wireFrame.logout() } - func showMessages(contact: Contact,call: NYNCall, callVC: CallViewProtocol, isVideo: Bool = false) { - - if isVideo { - if VoxService.sharedInstance.isRemoveVideoStream { - view.showPartnerVideoViewWithPhotoURL(url: contact.avatarUrl) - } else { - let prevView = self.view.showPartnerVideoView() - self.interactor.setVideoView(view: prevView) - } - } else { - self.view.showReturnToCall(call: call) - } - self.wireFrame.showMessages(contact: contact, callVC: callVC,isVideo: isVideo) - } - - func showMessages (room: Room, call: NYNCall, callVC: CallViewProtocol, isVideo: Bool = false) { - - self.view.showReturnToCall(call: call) - self.wireFrame.showMessages(room:room, callVC: callVC, isVideo: isVideo) - } - func showMessages (room: Room, call: NYNCall, callVC: CallInProgressViewProtocol, isVideo: Bool = false) { self.view.showReturnToCall(call: call) diff --git a/Nynja/Modules/Main/WireFrame/MainWireframe.swift b/Nynja/Modules/Main/WireFrame/MainWireframe.swift index 7938f0f7c..5b6c07cfd 100644 --- a/Nynja/Modules/Main/WireFrame/MainWireframe.swift +++ b/Nynja/Modules/Main/WireFrame/MainWireframe.swift @@ -212,31 +212,12 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato } func incomingCall(call: VICall, isVideo: Bool) { - self.view?.view.endEditing(true) - self.call = call - if isVideo { - CallWireFrame().presentCall(navigation: self.navigation!, callMode:self.isGroup ? .incamingVideoGroupCall : .incamingVideoCall, contact: self.getNameFrom(call: call), call: call, main: self) - } else { - CallWireFrame().presentCall(navigation: self.navigation!, callMode:self.isGroup ? .incamingGroupCall : .incamingCall, contact: self.getNameFrom(call: call), call: call, main: self) - } } func ringing(call: VICall) { - self.view?.view.endEditing(true) - self.call = call - let callMode: CallMode = self.isGroup ? (self.isVideo ? .outGoingVideoGroupCall : .outGoingGroupCall) : (self.isVideo ? .outGoingVideoCall : .outGoingCall) - CallWireFrame().presentCall(navigation: navigation!, callMode: callMode, contact: self.getNameFrom(call: call), call: call, main: self) } func callClosed(call: VICall, isError: Bool) { - if !isVideo { - self.hideReturnToCallView() - } - if isVideo { - self.view?.hidePartnerVideoView() - } - navigation?.popViewController(animated: true) - navigation?.dismiss(animated: true, completion: nil) } func getNameFrom(call: VICall) -> Contact { @@ -252,21 +233,10 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato return contact } - var callVC :CallViewProtocol? var callInProgressVC :CallInProgressViewProtocol? var isVideo: Bool = false var isGroup: Bool = false - func showMessages(contact: Contact, callVC: CallViewProtocol, isVideo: Bool = false) { - self.isVideo = isVideo - self.view?.view.endEditing(true) - self.callVC = callVC - - if !isVideo { - self.showReturnToCallView() - } - showChat(contact) - } func showMessages(contact: Contact, callVC: CallInProgressViewProtocol, isVideo: Bool = false) { self.isVideo = isVideo @@ -279,19 +249,6 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato showChat(contact) } - func showMessages(room: Room, callVC: CallViewProtocol, isVideo: Bool = false) { - - self.isVideo = isVideo - self.view?.view.endEditing(true) - self.callVC = callVC - - if !isVideo { - self.showReturnToCallView() - } - - showChat(room) - } - func showMessages(room: Room, callVC: CallInProgressViewProtocol, isVideo: Bool = false) { self.isVideo = isVideo @@ -336,7 +293,6 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato func hideReturnToCallView() { updateTopContentNavigationOffset(0) - self.callVC = nil self.view?.hideReturnToCall() } @@ -351,9 +307,6 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato isVideo = false self.showReturnToCallView() self.view?.hidePartnerVideoView() - if let callVC = callVC as? CallViewController { - callVC.changeUIToIncall() - } // if let call = self.call { // self.view?.showReturnToCall(call: call) @@ -362,13 +315,7 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato func returnToCall() { - if callVC != nil { - - self.navigation?.pushViewController(callVC as! UIViewController, animated: true) - if !self.isVideo { - self.hideReturnToCallView() - } - } else if callInProgressVC != nil { + if callInProgressVC != nil { self.navigation?.pushViewController(callInProgressVC as! UIViewController, animated: true) if !self.isVideo { -- GitLab From dfcf136815539ff50501b9f2b00eaf7ba73918e8 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 09:40:06 +0300 Subject: [PATCH 16/27] Removed Call VIPER and dependant --- Nynja.xcodeproj/project.pbxproj | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index ccc55e272..aecfcb3f3 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -51,7 +51,6 @@ 0062D94E2062EDB000B915AC /* InviteFriendsItemsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0062D94D2062EDAF00B915AC /* InviteFriendsItemsFactory.swift */; }; 0070FB0004EFB510C3409746 /* AddContactByUsernamePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505C687860C446A37E2FE4FF /* AddContactByUsernamePresenter.swift */; }; 00772A49F4B53A5EB669E8F2 /* AddParticipantsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9BA5392968EF1C9E844C927 /* AddParticipantsInteractor.swift */; }; - 00BB79AE09C68C716BF81645 /* CallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE839D7AC2C332E0234BC166 /* CallViewController.swift */; }; 00D7B5C720285BA7004B0E2B /* ScheduleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D7B5C620285BA7004B0E2B /* ScheduleView.swift */; }; 00E4A65F201A287100CEC61F /* MapSearchDS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E4A65E201A287100CEC61F /* MapSearchDS.swift */; }; 00E8513B2021E96E007DC792 /* GApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E8513A2021E96E007DC792 /* GApiResponse.swift */; }; @@ -434,7 +433,6 @@ 2CB54DD94DA23D7160F36472 /* SecurityWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48276F2EE408C27334B2894C /* SecurityWireframe.swift */; }; 2F2A5C12A7202E7834F923DC /* GroupRulesWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520422E90094C6C267AECE7E /* GroupRulesWireframe.swift */; }; 2F7C7F7837BDE6F5767A3A8C /* GroupStorageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D5302025583482829BBF2E /* GroupStorageViewController.swift */; }; - 314D0EEBF8C227FD046D43BA /* CallWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0974A63763BCB33814FC7A /* CallWireframe.swift */; }; 3219C8F242591BA17953FF33 /* SecurityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F509C0C8B9C738DBC7ABE07 /* SecurityViewController.swift */; }; 32868DD51F31CADF0028B260 /* ChatsListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32868DD41F31CADF0028B260 /* ChatsListProtocols.swift */; }; 32868DDB1F31CB500028B260 /* ChatsListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32868DDA1F31CB500028B260 /* ChatsListViewController.swift */; }; @@ -572,7 +570,6 @@ 4B4266C1204D917800194BC1 /* ActionsView+Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4266C0204D917800194BC1 /* ActionsView+Layout.swift */; }; 4B4266C3204D923400194BC1 /* Array+UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4266C2204D923400194BC1 /* Array+UIView.swift */; }; 4B5A714D204F069000A551F5 /* ChatService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5A714C204F069000A551F5 /* ChatService.swift */; }; - 4B6AA4B1F92A45DB56BDC44C /* CallProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12456F574C62670B98C16E4B /* CallProtocols.swift */; }; 4B736D4720237C140028F2CB /* CGSizeExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269D9DEF1FC3AF0D00324263 /* CGSizeExtension.swift */; }; 4B736D4920238FA40028F2CB /* ThumbnailGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B736D4820238FA40028F2CB /* ThumbnailGenerator.swift */; }; 4B7B81C62044790700C2EFCF /* TimeZoneLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7B81C52044790700C2EFCF /* TimeZoneLocal.swift */; }; @@ -603,7 +600,6 @@ 4D53FE7454959323B1CCFD96 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D270F638DBB2D8FC1BDEB633 /* ProfileViewController.swift */; }; 4DAEBCF361B86B0AD3C98749 /* EditUsernameInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE3BAC9B7EA418FB463EF04 /* EditUsernameInteractor.swift */; }; 50960A9A3A3E544A494B4642 /* EditPhotoProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E7F09BDC006C92CF84A481E /* EditPhotoProtocols.swift */; }; - 52720EA907F60135673F1A46 /* CallPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5373874E1CD82B33214ED96 /* CallPresenter.swift */; }; 54FFFD58388E2B660C1E5A05 /* MapPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10E04C696850BAF082139AAD /* MapPresenter.swift */; }; 553819525871F7D28AB90364 /* GroupRulesPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 705B62097A99515B3C778F35 /* GroupRulesPresenter.swift */; }; 5683555B8382F7F37FEE1AF5 /* ProfileWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA66D21FFC1A74CFD2F63C4 /* ProfileWireframe.swift */; }; @@ -646,7 +642,6 @@ 6D5157D01F30B36A002A27DB /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5157CF1F30B36A002A27DB /* ChatView.swift */; }; 6D5157D21F30B822002A27DB /* MicrophoneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5157D11F30B822002A27DB /* MicrophoneView.swift */; }; 6D5168A21F30430900DA3728 /* SpeakerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5168A11F30430900DA3728 /* SpeakerView.swift */; }; - 6D5168A41F30638400DA3728 /* CallInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5168A31F30638400DA3728 /* CallInteractor.swift */; }; 6D56F2101F39FC6A00CBF56D /* AmazonManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D56F20F1F39FC6A00CBF56D /* AmazonManager.swift */; }; 6D6234F61F1E150600EF375F /* HistoryTableDS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6234F51F1E150600EF375F /* HistoryTableDS.swift */; }; 6D6234F81F1E158600EF375F /* HistoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6234F71F1E158600EF375F /* HistoryCell.swift */; }; @@ -2170,7 +2165,6 @@ 0E7F09BDC006C92CF84A481E /* EditPhotoProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditPhotoProtocols.swift; sourceTree = ""; }; 0FF56F6F8D90FB98A6B42971 /* EditGroupNameInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditGroupNameInteractor.swift; sourceTree = ""; }; 10E04C696850BAF082139AAD /* MapPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapPresenter.swift; sourceTree = ""; }; - 12456F574C62670B98C16E4B /* CallProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CallProtocols.swift; sourceTree = ""; }; 1457809A715A3526EBF39205 /* MainViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 1746BDC1030434814FE63E0A /* DateTimePickerPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DateTimePickerPresenter.swift; sourceTree = ""; }; 17B34E74A0246B17348E9597 /* Pods-Nynja.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Nynja.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Nynja/Pods-Nynja.debug.xcconfig"; sourceTree = ""; }; @@ -2644,7 +2638,6 @@ 6D5157CF1F30B36A002A27DB /* ChatView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = ""; }; 6D5157D11F30B822002A27DB /* MicrophoneView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MicrophoneView.swift; sourceTree = ""; }; 6D5168A11F30430900DA3728 /* SpeakerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpeakerView.swift; sourceTree = ""; }; - 6D5168A31F30638400DA3728 /* CallInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallInteractor.swift; sourceTree = ""; }; 6D56F20F1F39FC6A00CBF56D /* AmazonManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonManager.swift; sourceTree = ""; }; 6D5A57913B84E0665E3ABC0E /* EditGroupPhotoPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditGroupPhotoPresenter.swift; sourceTree = ""; }; 6D6234F51F1E150600EF375F /* HistoryTableDS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryTableDS.swift; sourceTree = ""; }; @@ -2662,7 +2655,6 @@ 718EF22D86A9656BB6ED89D5 /* Pods-Nynja.translate.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Nynja.translate.xcconfig"; path = "Pods/Target Support Files/Pods-Nynja/Pods-Nynja.translate.xcconfig"; sourceTree = ""; }; 7625A2CFF245BC8A47701724 /* AddParticipantsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AddParticipantsPresenter.swift; sourceTree = ""; }; 762BA232B5D027BD943DFA18 /* SecurityPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SecurityPresenter.swift; sourceTree = ""; }; - 7C0974A63763BCB33814FC7A /* CallWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CallWireframe.swift; sourceTree = ""; }; 7C19AFE8E64821851F4112EE /* ProfileProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ProfileProtocols.swift; sourceTree = ""; }; 7C2CBB5F32D209160D00F744 /* CreateGroupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreateGroupViewController.swift; sourceTree = ""; }; 7CFD3063186FFCB048E843FD /* SelectCountryViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectCountryViewController.swift; sourceTree = ""; }; @@ -3748,7 +3740,6 @@ F1EED41420C57C30001060C4 /* PhotoPreviewSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoPreviewSource.swift; sourceTree = ""; }; F1F219FC7966064C555AC2A4 /* TopUpAccountViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TopUpAccountViewController.swift; sourceTree = ""; }; F46A5D92A279FA0A509DA508 /* Pods-NynjaUnitTests.translate.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NynjaUnitTests.translate.xcconfig"; path = "Pods/Target Support Files/Pods-NynjaUnitTests/Pods-NynjaUnitTests.translate.xcconfig"; sourceTree = ""; }; - F5373874E1CD82B33214ED96 /* CallPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CallPresenter.swift; sourceTree = ""; }; F56141F2CF85255940EA304F /* EditPhotoWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditPhotoWireframe.swift; sourceTree = ""; }; F79C9355E1AA4B373567F765 /* LanguageSettingsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageSettingsInteractor.swift; sourceTree = ""; }; F96FD91024D36848A4A4277C /* AddContactViaPhoneProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AddContactViaPhoneProtocols.swift; sourceTree = ""; }; @@ -3815,7 +3806,6 @@ FE21ACB82113AB3B006010A0 /* KeychainServiceTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeychainServiceTest.swift; sourceTree = ""; }; FE58F9B0208F00FE004AFDD3 /* MessageEditActionTable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageEditActionTable.swift; sourceTree = ""; }; FE58F9B2208F0583004AFDD3 /* DBMessageEditAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DBMessageEditAction.swift; sourceTree = ""; }; - FE839D7AC2C332E0234BC166 /* CallViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CallViewController.swift; sourceTree = ""; }; FE9E70CF21175DDC0034067A /* ChatScreenAlertFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatScreenAlertFactory.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -8425,7 +8415,6 @@ A33FA59FE338E9660AB10CD1 /* Presenter */ = { isa = PBXGroup; children = ( - F5373874E1CD82B33214ED96 /* CallPresenter.swift */, ); path = Presenter; sourceTree = ""; @@ -9820,7 +9809,6 @@ A4D0787972A19641165C28B6 /* WireFrame */ = { isa = PBXGroup; children = ( - 7C0974A63763BCB33814FC7A /* CallWireframe.swift */, ); path = WireFrame; sourceTree = ""; @@ -9849,7 +9837,6 @@ A895793051E246613AC4F30F /* View */ = { isa = PBXGroup; children = ( - FE839D7AC2C332E0234BC166 /* CallViewController.swift */, 6D67310F1F29E1F4003E8F8F /* BottomCallView.swift */, 6D5168A11F30430900DA3728 /* SpeakerView.swift */, 6D5157CF1F30B36A002A27DB /* ChatView.swift */, @@ -10018,7 +10005,6 @@ 9BD8E3EC20EF7776001384EC /* CallScreens */, 5BC1D38320D3B670002A44B3 /* CallCreatorMediator.swift */, 9BC9657520FF042D00052AE1 /* CallInProgressProtocols.swift */, - 12456F574C62670B98C16E4B /* CallProtocols.swift */, A895793051E246613AC4F30F /* View */, A33FA59FE338E9660AB10CD1 /* Presenter */, D6365C3D94F0150AFA59F586 /* Interactor */, @@ -10283,7 +10269,6 @@ D6365C3D94F0150AFA59F586 /* Interactor */ = { isa = PBXGroup; children = ( - 6D5168A31F30638400DA3728 /* CallInteractor.swift */, ); path = Interactor; sourceTree = ""; @@ -13762,7 +13747,6 @@ C9C695032022306D00A57297 /* SelectCountryTableDataSource.swift in Sources */, 8584C90F20920F3C001A0BBB /* StickerGridCellModel.swift in Sources */, A42D51A4206A361400EEB952 /* Feature.swift in Sources */, - 6D5168A41F30638400DA3728 /* CallInteractor.swift in Sources */, 260552A61F9E1CD100D68DE6 /* SearchHandler.swift in Sources */, F1607B1F20B21A9D00BDF60A /* CameraViewController.swift in Sources */, 853E595B20D71E6C007799B9 /* StickerPack+DB.swift in Sources */, @@ -14164,7 +14148,6 @@ 4BAB9CE02035CAE700385520 /* ScheduleInfo.swift in Sources */, 8ECC067E1FC5BCC6002CF225 /* TransferManager.swift in Sources */, A42D52B2206A53AA00EEB952 /* Cursor_Spec.swift in Sources */, - 4B6AA4B1F92A45DB56BDC44C /* CallProtocols.swift in Sources */, E76D13311FA35F3500B07F0E /* TextCellModel.swift in Sources */, E734831C1F9F53050090A4DB /* ProfileViewSectionDelegate.swift in Sources */, F10AFEB720F7B1B000C7CE83 /* WheelMediaFullItemPreview.swift in Sources */, @@ -14172,14 +14155,12 @@ F105C69D209F71BF0091786A /* CameraWireframe.swift in Sources */, A458FABF20EB8BB50075D55E /* MessageInteractor+ChannelActions.swift in Sources */, 26CD3FDD2104D1DD00597E62 /* AudioConvertionOperation.swift in Sources */, - 00BB79AE09C68C716BF81645 /* CallViewController.swift in Sources */, 8514F17C20EA219F00883513 /* ContextMenuConfiguration.swift in Sources */, FBCE840D20E525A6003B7558 /* HTTPResponseResult.swift in Sources */, A43B259F20AB1DFA00FF8107 /* PickerCell.swift in Sources */, 2661D12E1F373D1700F3E125 /* BadgeView.swift in Sources */, F10B0E1F20B4CC5400528E7A /* CameraSettingsCoordinator.swift in Sources */, F119E67920D27EA50043A532 /* VideoPreviewCVCell.swift in Sources */, - 52720EA907F60135673F1A46 /* CallPresenter.swift in Sources */, 8502DB542061030100613C8C /* WheelPositionPickerViewController.swift in Sources */, A45F116120B422AF00F45004 /* Message+System.swift in Sources */, FBCE83E020E52496003B7558 /* ContactServices.swift in Sources */, @@ -14190,7 +14171,6 @@ 85433F2C204D5AA500B373A7 /* NynjaCloseButton.swift in Sources */, A44B4D5A20CE9BDF00CA700A /* SwitchCell.swift in Sources */, F1607B3020B2FD5A00BDF60A /* QRNotificationVIew.swift in Sources */, - 314D0EEBF8C227FD046D43BA /* CallWireframe.swift in Sources */, 260313A420A0A4BA009AC66D /* DirectableActionCellViewModel.swift in Sources */, 859773232087965700B03B4A /* NynjaControlContainerView.swift in Sources */, E743B58A1FB0911200F72F92 /* ParticipantsContactCell.swift in Sources */, -- GitLab From b87b92722135fb308578bbcb6c71f8920a60e3ee Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 09:40:59 +0300 Subject: [PATCH 17/27] Changed server to CallSDK --- Nynja/Resources/DevConfig.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nynja/Resources/DevConfig.xcconfig b/Nynja/Resources/DevConfig.xcconfig index 05443e420..440779984 100644 --- a/Nynja/Resources/DevConfig.xcconfig +++ b/Nynja/Resources/DevConfig.xcconfig @@ -9,11 +9,11 @@ BundleIdentifier = com.nynja.dev.mobile.communicator ExtensionBundleIdentifier = com.nynja.dev.mobile.communicator.NynjaShare -ServerURL = 54.201.154.141 +ServerURL = 34.220.151.7 AppName = NYNJADev ServerPort = 1883 Config = dev AppGroup = group.com.nynja.mobile.communicator.dev ModelsVersion = 8 -ConfServerAddress = 35.198.118.190 +ConfServerAddress = 18.197.109.137 ConfServerPort = 80 -- GitLab From c39ff804678669015036c08a1b2c5c3bb55d007f Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 09:41:30 +0300 Subject: [PATCH 18/27] Separated NynjaCommunicatorServiceDelegate into two indpendant delegates because the logic is different --- .../NynjaUIKit.xcodeproj/project.pbxproj | 16 ++++ Nynja.xcodeproj/project.pbxproj | 16 ++++ .../Interactor/CallInProgressInteractor.swift | 74 +++++++++++++------ .../View/CallInProgressViewController.swift | 21 ++++++ .../Main/Presenter/MainPresenter.swift | 4 +- .../Main/WireFrame/MainWireframe.swift | 4 - Nynja/Services/NynjaCommunicatorService.swift | 43 ++++++----- externals/mobile-sdk-s4 | 2 +- 8 files changed, 133 insertions(+), 47 deletions(-) diff --git a/Frameworks/NynjaUIKit/NynjaUIKit.xcodeproj/project.pbxproj b/Frameworks/NynjaUIKit/NynjaUIKit.xcodeproj/project.pbxproj index d227aa966..3cfbcb641 100644 --- a/Frameworks/NynjaUIKit/NynjaUIKit.xcodeproj/project.pbxproj +++ b/Frameworks/NynjaUIKit/NynjaUIKit.xcodeproj/project.pbxproj @@ -328,6 +328,7 @@ 8514D4BD20EE27080002378A /* Frameworks */, 8514D4BE20EE27080002378A /* Headers */, 8514D4BF20EE27080002378A /* Resources */, + 46657F61D06BBC36D9E1E7E9 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -380,6 +381,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 46657F61D06BBC36D9E1E7E9 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../../Pods/Target Support Files/Pods-NynjaUIKit/Pods-NynjaUIKit-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 79BB170804CAF73DF4C1F030 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index aecfcb3f3..89f5401c9 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -12271,6 +12271,7 @@ 3578099F1F9765CF00C9680C /* Sources */, 357809A01F9765CF00C9680C /* Frameworks */, 357809A11F9765CF00C9680C /* Resources */, + 61CA315D0DB89815DE10E66F /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -12550,6 +12551,21 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 61CA315D0DB89815DE10E66F /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Nynja-Share/Pods-Nynja-Share-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 6A031053FD7153DBCCD6098C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 4bd053316..da01ab903 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -8,12 +8,13 @@ import VoxImplant -class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServiceDelegate, NynjaCommunicatorServiceDelegate { +class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServiceDelegate, NynjaCallDelegate { weak var presenter: CallInProgressInteractorOutputProtocol! weak var call: VICall? var vox = VoxService.sharedInstance + var callService = NynjaCommunicatorService.sharedInstance var timer: Timer? var contact: Contact? { @@ -23,24 +24,52 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic weak var nynCall: NYNCall? var duration = 0 + let storageService: StorageService = .sharedInstance + let payloadBuilder: MessagePayloadBuilderInput = MessagePayloadBuilder() + private let mqttService: MQTTService = .sharedInstance + let processingManager = DefaultMessagesProcessingManager.shared + private(set) lazy var messageFactory: MessageFactoryProtocol = { + let factory = MessageFactory() + + let dependencies = MessageFactory.Dependencies( + storageService: storageService, + payloadBuilder: payloadBuilder + ) + factory.inject(dependencies: dependencies) + + return factory + }() + + private(set) lazy var messageSendingService: MessageSendingServiceProtocol = { + let service = MessageSendingService() + let dependencies = MessageSendingService.Dependencies( + mqttService: mqttService, + storageService: storageService, + processingManager: processingManager + ) + service.inject(dependencies: dependencies) + + return service + }() + func setupDelegate() { vox.delegate = self - NynjaCommunicatorService.sharedInstance.delegate = self + callService.callDelegate = self } func acceptCall(withVideo: Bool) { if let id = call { vox.answer(call: id, withVideo: withVideo) } else if let ncall = self.nynCall { - NynjaCommunicatorService.sharedInstance.acceptConference(call: ncall) + callService.acceptConference(call: ncall) } } func rejectCall() { if let nc = self.nynCall { - NynjaCommunicatorService.sharedInstance.rejectConference(call: nc) + callService.rejectConference(call: nc) self.presenter.callClosed() } @@ -144,7 +173,7 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func switchCamera() { - NynjaCommunicatorService.sharedInstance.switchCamera() + callService.switchCamera() } // MARK: - VoxServiceDelegate @@ -194,18 +223,6 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } } - func dialing(call: NYNCall) { - - } - - func incomingCallRinging(call: NYNCall) { - - } - - func creatingGroupCall(name: String, call: NYNCall) { - - } - func didAddVideoStreamForCall(call: NYNCall) { self.presenter.didAddRemoteVideoStream() } @@ -219,15 +236,15 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic } func addRemoteVideoRenderer(inView view: UIView) { - NynjaCommunicatorService.sharedInstance.attachRemoteVideoRenderer(inView: view) + callService.attachRemoteVideoRenderer(inView: view) } func attachLocalVideoPreview(inView view: UIView) { - NynjaCommunicatorService.sharedInstance.attachLocalVideoPreview(inView: view) + callService.attachLocalVideoPreview(inView: view) } func detachLocalVideoPreview(inView view: UIView) { - NynjaCommunicatorService.sharedInstance.detachLocalVideoPreview(inView: view) + callService.detachLocalVideoPreview(inView: view) } func stopTimer () { @@ -288,6 +305,19 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic self.presenter.update(participants: ncall.participants) } } + + func conferenceCreated(call: NYNCall) { + sendCall(ncall: call) + } + + func sendCall(ncall: NYNCall) { + let room = Room() + room.id = ncall.externalInfo + let membersIds = ncall.participants.map({ $0.address ?? "" }) + let message = messageFactory.makeCallMessage(members: membersIds, room: room) + try? storageService.perform(action: .save, with: message) + messageSendingService.sendMessage(message) + } func updateGroupCall(contacts: [Contact]) { @@ -296,14 +326,14 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic for ctc in contacts { let name = "\(ctc.names ?? "") \(ctc.surnames ?? "")" - NynjaCommunicatorService.sharedInstance.addConferenceMember(conferenceId: ncall.callId, phoneId: ctc.phone_id!, name: name) + callService.addConferenceMember(conferenceId: ncall.callId, phoneId: ctc.phone_id!, name: name) } } } func removeCallMember(memberId: String) { if let ncall = self.nynCall { - NynjaCommunicatorService.sharedInstance.removeConferenceMember(conferenceId: ncall.callId, memberId: memberId) + callService.removeConferenceMember(conferenceId: ncall.callId, memberId: memberId) } } } diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 6e34a83b6..1e671d37a 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -6,6 +6,27 @@ // Copyright © 2018 TecSynt Solutions. All rights reserved. // +enum CallMode { + case incamingCall + case incamingGroupCall + case outGoingCall + case outGoingGroupCall + case incamingVideoCall + case incamingVideoGroupCall + case outGoingVideoCall + case outGoingVideoGroupCall +} + +enum CallStatus { + case callStarting + case callIncomingAudio + case callIncomingVideo + case callOutgoingAudio + case callOutgoingVideo + case callConnecting + case callInProgress +} + enum CallInProgressMode { case oneToOneAudio diff --git a/Nynja/Modules/Main/Presenter/MainPresenter.swift b/Nynja/Modules/Main/Presenter/MainPresenter.swift index b3d7a64e1..3ae063335 100644 --- a/Nynja/Modules/Main/Presenter/MainPresenter.swift +++ b/Nynja/Modules/Main/Presenter/MainPresenter.swift @@ -65,8 +65,8 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } func videoCall() { - - self.wireFrame.showNotImplementedAlert() + self.wireFrame.isGroup = false + self.performVideoCall() } func videoGroupCall() { diff --git a/Nynja/Modules/Main/WireFrame/MainWireframe.swift b/Nynja/Modules/Main/WireFrame/MainWireframe.swift index 5b6c07cfd..822d6481b 100644 --- a/Nynja/Modules/Main/WireFrame/MainWireframe.swift +++ b/Nynja/Modules/Main/WireFrame/MainWireframe.swift @@ -266,10 +266,6 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato } - func stateDidChange(call: NYNCall, state: NYNCallState) { - //TODO: Propagate to call view - } - func viewShowed() { VoxService.sharedInstance.delegate = self NynjaCommunicatorService.sharedInstance.delegate = self diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index 73f3a4c9d..a8a2ded43 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -12,10 +12,19 @@ import NynjaSDK protocol NynjaCommunicatorServiceDelegate: class { func dialing(call: NYNCall) func creatingGroupCall(name: String, call: NYNCall) + func incomingCallRinging(call: NYNCall) +} + +extension NynjaCommunicatorServiceDelegate { + func dialing(call: NYNCall) {} + func creatingGroupCall(name: String, call: NYNCall){} + func incomingCallRinging(call: NYNCall){} +} + +protocol NynjaCallDelegate: class { func callEnded(call: NYNCall, isError: Bool) func stateDidChange(call: NYNCall, state: NYNCallState) func participantsUpdated(call: NYNCall) - func incomingCallRinging(call: NYNCall) func conferenceCreated(call: NYNCall) func didAddVideoStreamForCall(call: NYNCall) func didRemoveVideoStreamForCall(call: NYNCall) @@ -23,13 +32,10 @@ protocol NynjaCommunicatorServiceDelegate: class { func didStopLocalCapturerForCall(call: NYNCall) } -extension NynjaCommunicatorServiceDelegate { - func dialing(call: NYNCall) {} - func creatingGroupCall(name: String, call: NYNCall){} +extension NynjaCallDelegate { func callEnded(call: NYNCall, isError: Bool) {} - func stateDidChange(call: NYNCall, state: NYNCallState){} + func stateDidChange(call: NYNCall, state: NYNCallState) {} func participantsUpdated(call: NYNCall){} - func incomingCallRinging(call: NYNCall){} func conferenceCreated(call: NYNCall) {} func didAddVideoStreamForCall(call: NYNCall) {} func didRemoveVideoStreamForCall(call: NYNCall) {} @@ -43,6 +49,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele let nynComm: NynjaCommunicator var isCallInProgress = false weak var delegate : NynjaCommunicatorServiceDelegate? + weak var callDelegate : NynjaCallDelegate? var call:NYNCall? private var creators: [String: CallCreatorMediator] = [String: CallCreatorMediator]() var username: String? @@ -241,7 +248,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func didChangeConferenceState(_ state: NYNCallState) { if let c = self.call { - self.delegate?.stateDidChange(call: c, state: state) + self.callDelegate?.stateDidChange(call: c, state: state) } } @@ -380,7 +387,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func callDidEnd(_ call: NYNCall) { isCallInProgress = false if let c = self.call, call.callId.elementsEqual(c.callId) { - self.delegate?.callEnded(call: c, isError: false) + self.callDelegate?.callEnded(call: c, isError: false) self.call?.setDelegate(nil) self.call = nil } @@ -391,7 +398,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele LogService.log(topic: .callSystem, text: log) if let c = self.call, let cid = callid { if c.callId.elementsEqual(cid) { - self.delegate?.stateDidChange(call: c, state: state) + self.callDelegate?.stateDidChange(call: c, state: state) } } } @@ -401,7 +408,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele LogService.log(topic: .callSystem, text: log) if let c = self.call, let cid = callid { if cid.elementsEqual(c.callId) { - self.delegate?.participantsUpdated(call: c) + self.callDelegate?.participantsUpdated(call: c) } } } @@ -411,7 +418,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele LogService.log(topic: .callSystem, text: log) if let c = self.call{ if c.callId.elementsEqual(call.callId) { - self.delegate?.didAddVideoStreamForCall(call: call) + self.callDelegate?.didAddVideoStreamForCall(call: call) } } } @@ -421,7 +428,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele LogService.log(topic: .callSystem, text: log) if let c = self.call { if c.callId.elementsEqual(call.callId) { - self.delegate?.didRemoveVideoStreamForCall(call: call) + self.callDelegate?.didRemoveVideoStreamForCall(call: call) } } } @@ -429,7 +436,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func callDidStartLocalCapturer(_ call: NYNCall) { if let c = self.call{ if c.callId.elementsEqual(call.callId) { - self.delegate?.didStartLocalCapturerForCall(call: call) + self.callDelegate?.didStartLocalCapturerForCall(call: call) } } } @@ -437,7 +444,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func callDidStopLocalCapturer(_ call: NYNCall) { if let c = self.call{ if c.callId.elementsEqual(call.callId) { - self.delegate?.didStopLocalCapturerForCall(call: call) + self.callDelegate?.didStopLocalCapturerForCall(call: call) } } } @@ -500,7 +507,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele self.nynComm.getCallManager().startConference(withRequestId: cr.startId!, withConferenceId: cr.conferenceId!) guard let call = self.call else { return } - self.delegate?.conferenceCreated(call: call) + self.callDelegate?.conferenceCreated(call: call) } } } @@ -538,7 +545,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele // clean up call if let c = self.call, c.callId.elementsEqual(cr.conferenceId!) { - self.delegate?.callEnded(call: c, isError: true) + self.callDelegate?.callEnded(call: c, isError: true) self.call?.setDelegate(nil) self.call = nil isCallInProgress = false @@ -564,7 +571,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele // clean up call if let c = self.call, call.callId.elementsEqual(cr.conferenceId!) { - self.delegate?.callEnded(call: c, isError: true) + self.callDelegate?.callEnded(call: c, isError: true) self.call?.setDelegate(nil) self.call = nil isCallInProgress = false @@ -619,7 +626,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele func didStopRingingIncomingCall(withId conferenceId: String) { // clean up call if let c = self.call, c.callId.elementsEqual(conferenceId) { - self.delegate?.callEnded(call: c, isError: false) + self.callDelegate?.callEnded(call: c, isError: false) self.call?.setDelegate(nil) self.call = nil isCallInProgress = false diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index b70ad6c68..862f726cd 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit b70ad6c6855c212b343c98b10bc82d3ff09a740f +Subproject commit 862f726cd8442785848acb0e8524357b5cad5eb4 -- GitLab From b908292373ac09acb4d712343c0b49908846222b Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Wed, 8 Aug 2018 11:21:06 +0300 Subject: [PATCH 19/27] Fixed NY-2392: iOS: Calling freezing (Marshal's issue) --- Nynja/Modules/Main/WireFrame/MainWireframe.swift | 2 +- Nynja/Services/NynjaCommunicatorService.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Nynja/Modules/Main/WireFrame/MainWireframe.swift b/Nynja/Modules/Main/WireFrame/MainWireframe.swift index 822d6481b..8066f6700 100644 --- a/Nynja/Modules/Main/WireFrame/MainWireframe.swift +++ b/Nynja/Modules/Main/WireFrame/MainWireframe.swift @@ -263,7 +263,7 @@ class MainWireFrame: MainWireFrameProtocol, VoxServiceDelegate, NynjaCommunicato } func callEnded(call: NYNCall, isError: Bool) { - + self.hideReturnToCallView() } func viewShowed() { diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index a8a2ded43..580c8c8e1 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -13,12 +13,14 @@ protocol NynjaCommunicatorServiceDelegate: class { func dialing(call: NYNCall) func creatingGroupCall(name: String, call: NYNCall) func incomingCallRinging(call: NYNCall) + func callEnded(call: NYNCall, isError: Bool) } extension NynjaCommunicatorServiceDelegate { func dialing(call: NYNCall) {} func creatingGroupCall(name: String, call: NYNCall){} func incomingCallRinging(call: NYNCall){} + func callEnded(call: NYNCall, isError: Bool){} } protocol NynjaCallDelegate: class { @@ -388,6 +390,7 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele isCallInProgress = false if let c = self.call, call.callId.elementsEqual(c.callId) { self.callDelegate?.callEnded(call: c, isError: false) + self.delegate?.callEnded(call: c, isError: false) self.call?.setDelegate(nil) self.call = nil } -- GitLab From 4f89a51f8df7846e3271c14c7e430542559ef0a1 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 12:12:54 +0300 Subject: [PATCH 20/27] optimized view z-order insid call screen --- .../Presenter/CallInProgressPresenter.swift | 1 - .../View/CallInProgressViewController.swift | 124 ++++++++++-------- .../WireFrame/CallInProgressWireframe.swift | 17 +-- externals/mobile-sdk-s4 | 2 +- 4 files changed, 74 insertions(+), 70 deletions(-) diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 0ca366925..537208e16 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -167,7 +167,6 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn } func viewShowed() { - self.interactor.setupDelegate() } // MARK: EditParticpantsDelegate diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 1e671d37a..1688f4407 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -53,8 +53,10 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa let middleGVHeight: Float = 100.0 let statusBarHeight: Float = Float(UIApplication.shared.statusBarFrame.size.height) - var collapsed: Bool = false - + var collapsed: Bool = false + var initialized: Bool = false + var needLocalRenderer: Bool = false + var needRemoteRenderer: Bool = false private struct ConstraintConstants { @@ -456,7 +458,7 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa label.snp.makeConstraints({ (make) in make.left.equalTo(self.view).offset(offset) - make.bottom.equalTo(self.cameraButton.snp.top).offset(0)//offset(0) + make.bottom.equalTo(self.bottomView.snp.top).offset(0) }) return label @@ -542,64 +544,61 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func setupVisibility() { + // for all modes in view self.nameLabel.isHidden = false - self.statusLabel.isHidden = false - self.declineButton.isHidden = false - self.collectionView.isHidden = true + + self.heldCallTitle.isHidden = true + self.heldCallDescription.isHidden = true + self.activeCallTitle.isHidden = true + self.activeCallDescription.isHidden = true + self.openCloseCallsButton.isHidden = true + self.openCloseCallsButton.isEnabled = false + // for all modes in bottom view + self.declineButton.isHidden = false self.speakerButton.isHidden = false self.speakerLabel.isHidden = false - self.cameraButton.isHidden = false self.cameraLabel.isHidden = false - self.microphoneButton.isHidden = false self.muteLabel.isHidden = false - self.messageButton.isHidden = false self.chatLabel.isHidden = false self.messageButton.isEnabled = (nil != self.contact) || (self.roomId.count > 0) - self.moreButton.isHidden = false self.moreLabel.isHidden = false self.moreButton.isEnabled = false - self.heldCallTitle.isHidden = true - self.heldCallDescription.isHidden = true - - self.activeCallTitle.isHidden = true - self.activeCallDescription.isHidden = true - - self.openCloseCallsButton.isHidden = true - self.openCloseCallsButton.isEnabled = false - switch self.callInProgressMode! { case .oneToOneAudio: - self.collectionView.isHidden = true self.myVideoView.isHidden = true self.otherVideoView.isHidden = true self.switchCameraButton.isHidden = true self.backgroundImage.isHidden = false self.backgroundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) + self.view.bringSubview(toFront: self.backgroundImage) case .oneToOneVideo: - self.collectionView.isHidden = true self.switchCameraButton.isHidden = true self.myVideoView.isHidden = true self.otherVideoView.isHidden = false - self.view.sendSubview(toBack: otherVideoView) - self.view.sendSubview(toBack: myVideoView) self.backgroundImage.isHidden = false self.backgroundImage.setImage(url: self.contact?.avatarUrl, placeHolder: UIImage(named: "ava_placeholder")) + self.view.bringSubview(toFront: self.backgroundImage) + self.view.bringSubview(toFront: self.otherVideoView) + self.view.bringSubview(toFront: self.myVideoView) + self.view.bringSubview(toFront: self.switchCameraButton) case .groupAudio: self.collectionView.isHidden = false self.myVideoView.isHidden = true self.otherVideoView.isHidden = true self.switchCameraButton.isHidden = true self.backgroundImage.isHidden = true + self.view.bringSubview(toFront: self.collectionView) } + self.view.bringSubview(toFront: self.bottomView) self.view.bringSubview(toFront: self.nameLabel) self.view.bringSubview(toFront: self.statusLabel) } @@ -643,7 +642,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa // backgtoundVideoImage.image = backgtoundImage.image // // partnerVideoView.isHidden = true -// self.contentVideoView.bringSubview(toFront: self.yourVideoView) } @@ -658,11 +656,16 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.view.layoutIfNeeded() self.presenter.viewShowed() -// self.presenter.setupViews(myView: yourVideoView, remoteView: partnerVideoView) -// -// // Note: need to prevent weird animation with remote and local video views. -// self.partnerVideoView.layoutIfNeeded() -// self.yourVideoView.layoutIfNeeded() + + if self.needLocalRenderer { + self.didStartLocalCapturer() + self.needLocalRenderer = false + } + + if self.needRemoteRenderer { + self.didAddRemoteVideoStream() + self.needRemoteRenderer = false + } } override func initialize() { @@ -672,6 +675,9 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa self.presenter.willShow() setupVisibility() + + // mark view as initialized + self.initialized = true } //MARK: Collection View Delegates @@ -766,14 +772,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa @objc func speakerButtonPressed() { - let state = AudioManager.sharedInstance.speaker - switch state { - case .loud: - AudioManager.sharedInstance.speaker = .soft - case .soft: - AudioManager.sharedInstance.speaker = .loud - } - presenter.speakerAction() } @@ -944,37 +942,55 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa } func didAddRemoteVideoStream() { + if self.initialized { + handleDidAddRemoteVideoStream() + } else { + self.needRemoteRenderer = true + } + } + + func didStartLocalCapturer() { + if self.initialized { + handleDidStartLocalCapturer() + } else { + self.needLocalRenderer = true + } + } + + func didStopLocalCapturer() { + if self.initialized { + handleDidStopLocalCapturer() + } else { + self.needLocalRenderer = false + } + } + + private func handleDidAddRemoteVideoStream() { self.otherVideoView.isHidden = false self.switchCameraButton.isHidden = false - self.view.bringSubview(toFront: self.otherVideoView) - self.view.insertSubview(self.switchCameraButton, aboveSubview: self.otherVideoView) self.backgroundImage.isHidden = true self.backgroundImage.image = nil self.view.sendSubview(toBack: self.backgroundImage) - + self.presenter.addRemoteVideoRenderer(inView: self.otherVideoView); - - self.view.bringSubview(toFront: self.nameLabel) - self.view.bringSubview(toFront: self.statusLabel) } - - func didStartLocalCapturer() { - + + private func handleDidStartLocalCapturer() { + self.myVideoView.isHidden = false self.view.insertSubview(self.myVideoView, aboveSubview: self.otherVideoView) - + self.presenter.attachLocalVideoPreview(inView: self.myVideoView); - - self.view.bringSubview(toFront: self.nameLabel) - self.view.bringSubview(toFront: self.statusLabel) } - - func didStopLocalCapturer() { - + + private func handleDidStopLocalCapturer() { + self.myVideoView.isHidden = true self.view.sendSubview(toBack: self.myVideoView) - + self.presenter.dettachLocalVideoPreview(inView: self.myVideoView); } + + } diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift index 2bc66b6da..f5766f936 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift @@ -45,6 +45,7 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { interactor.presenter = presenter navigation.pushViewController(view as UIViewController, animated: true) + interactor.setupDelegate() } func presentDialInCall(navigation: UINavigationController, callInProgressMode: CallInProgressMode, contact: Contact?, call: NYNCall? = nil, main: MainWireFrame?) { @@ -71,6 +72,7 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { interactor.presenter = presenter navigation.pushViewController(view as UIViewController, animated: true) + interactor.setupDelegate() } func presentCreateGroupCall(navigation: UINavigationController, callInProgressMode: CallInProgressMode, main: MainWireFrame?, call: NYNCall) { @@ -100,6 +102,7 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { interactor.presenter = presenter navigation.pushViewController(view as UIViewController, animated: true) + interactor.setupDelegate() } func messageActionWith(room: Room, isVideo: Bool) { @@ -151,20 +154,6 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { })) } - // if participant.isMuted { - // actionSheet.addAction(UIAlertAction(title: "mute_call".localized, - // style: .default, - // handler: { (action) in - // delegate.mute(participant: participant) - // })) - // } else { - // actionSheet.addAction(UIAlertAction(title: "unmute".localized, - // style: .default, - // handler: { (action) in - // delegate.unmute(participant: participant) - // })) - // } - actionSheet.addAction(UIAlertAction(title: "cancel".localized, style: .cancel, handler: { (action) in self.navigation?.dismiss(animated: true, completion: nil) diff --git a/externals/mobile-sdk-s4 b/externals/mobile-sdk-s4 index 862f726cd..5bd083a74 160000 --- a/externals/mobile-sdk-s4 +++ b/externals/mobile-sdk-s4 @@ -1 +1 @@ -Subproject commit 862f726cd8442785848acb0e8524357b5cad5eb4 +Subproject commit 5bd083a74dcf787903cee307fbf9ab945b326708 -- GitLab From 6ecb5299fce4336b51ccaf292176e6b9d18f71c7 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Wed, 8 Aug 2018 13:04:24 +0300 Subject: [PATCH 21/27] Changed env to Dev Changed dissapearance of Call VIPER on call end --- Nynja/Modules/Call/CallInProgressProtocols.swift | 1 + .../CallInProgress/Presenter/CallInProgressPresenter.swift | 5 +---- .../CallInProgress/WireFrame/CallInProgressWireframe.swift | 7 ++++++- Nynja/Resources/DevConfig.xcconfig | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index 7cb9abce6..86dad4665 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -20,6 +20,7 @@ protocol CallInProgressWireFrameProtocol: class { func messageActionWith(room:Room, isVideo: Bool) func updateCallParticipants() func showMenuWith(participant: NYNCallParticipant?, delegate: ManageCallInProgressParticipantsProtocol) + func callClosed() } protocol CallInProgressViewProtocol: class { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 537208e16..a0ff75729 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -83,10 +83,7 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn } func callClosed() { - if let navigation = (self.view as? UIViewController)?.navigationController { - (navigation.parent as? MainViewProtocol)?.presenter.wireFrame.hideReturnToCallView() - navigation.popViewController(animated: true) - } + wireFrame.callClosed() } func callConnected(withVideo: Bool) { diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift index f5766f936..dc68a9c63 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift @@ -161,7 +161,12 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { navigation?.present(actionSheet, animated: true, completion: nil) } - + + func callClosed() { + LogService.log(topic: .callSystem, text: "call view popped to root") + navigation?.popViewController(animated: true) + } + func removeParticipant(participant:NYNCallParticipant?) { } diff --git a/Nynja/Resources/DevConfig.xcconfig b/Nynja/Resources/DevConfig.xcconfig index 440779984..05443e420 100644 --- a/Nynja/Resources/DevConfig.xcconfig +++ b/Nynja/Resources/DevConfig.xcconfig @@ -9,11 +9,11 @@ BundleIdentifier = com.nynja.dev.mobile.communicator ExtensionBundleIdentifier = com.nynja.dev.mobile.communicator.NynjaShare -ServerURL = 34.220.151.7 +ServerURL = 54.201.154.141 AppName = NYNJADev ServerPort = 1883 Config = dev AppGroup = group.com.nynja.mobile.communicator.dev ModelsVersion = 8 -ConfServerAddress = 18.197.109.137 +ConfServerAddress = 35.198.118.190 ConfServerPort = 80 -- GitLab From ea7eb291be6c45416de6c8c2496bbc4f541a79a4 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Thu, 9 Aug 2018 10:50:53 +0300 Subject: [PATCH 22/27] Fixed NY-2363 --- .../AddParticipantsProtocols.swift | 2 +- .../Presenter/AddParticipantsPresenter.swift | 6 +++++ .../View/AddParticipantsViewController.swift | 22 +++++-------------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Nynja/Modules/AddParticipants/AddParticipantsProtocols.swift b/Nynja/Modules/AddParticipants/AddParticipantsProtocols.swift index 00dd6bad4..98cd7d640 100644 --- a/Nynja/Modules/AddParticipants/AddParticipantsProtocols.swift +++ b/Nynja/Modules/AddParticipants/AddParticipantsProtocols.swift @@ -40,7 +40,7 @@ protocol AddParticipantsViewProtocol: class { func updateParticipantsList(_ participants: GroupedParticipants) } -protocol AddParticipantsPresenterProtocol: BasePresenterProtocol { +protocol AddParticipantsPresenterProtocol: BasePresenterProtocol, NavigationProtocol { var view: AddParticipantsViewProtocol! { get set } var interactor: AddParticipantsInteractorInputProtocol! { get set } diff --git a/Nynja/Modules/AddParticipants/Presenter/AddParticipantsPresenter.swift b/Nynja/Modules/AddParticipants/Presenter/AddParticipantsPresenter.swift index 66579585c..bfca0fb1c 100644 --- a/Nynja/Modules/AddParticipants/Presenter/AddParticipantsPresenter.swift +++ b/Nynja/Modules/AddParticipants/Presenter/AddParticipantsPresenter.swift @@ -117,6 +117,12 @@ class AddParticipantsPresenter: BasePresenter, AddParticipantsPresenterProtocol, } } } + + // MARK: NavigationProtocol + func back() { + let arr:[Contact] = [] + hide(with: arr) + } // MARK: - AddParticipantsInteractorOutputProtocol diff --git a/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift b/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift index 312e41406..729a8a7f2 100644 --- a/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift +++ b/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift @@ -8,7 +8,7 @@ import UIKit -class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol, NavigationProtocol { +class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol { var presenter: AddParticipantsPresenterProtocol! { didSet { @@ -148,7 +148,6 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol, Naviga var title:String = "" var backBtnImage:UIImage? = nil - var selectAllBtnImage:UIImage? = nil var navHandler:NavigationProtocol? = nil if presenter.participantsMode == .delete { @@ -156,21 +155,18 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol, Naviga } else if presenter.participantsMode == .createGroupCall { title = "add_members_to_call".localized.uppercased() backBtnImage = UIImage(named:"ic_close_clear") - selectAllBtnImage = UIImage(named:"ic_unchecked") - navHandler = self + navHandler = presenter self.selectAllButtonVisible = true } else if presenter.participantsMode == .updateGroupCall { title = "add_members_to_call".localized.uppercased() backBtnImage = UIImage(named:"ic_close_clear") - selectAllBtnImage = UIImage(named:"ic_unchecked") - navHandler = self + navHandler = presenter self.selectAllButtonVisible = true } else if presenter.participantsMode == .createConferenceCall { - title = "add_members_to_call".localized.uppercased() title = "add_members_to_call".localized.uppercased() backBtnImage = UIImage(named:"ic_close_clear") - selectAllBtnImage = UIImage(named:"ic_unchecked") - navHandler = self + navHandler = presenter + self.selectAllButtonVisible = true } else if presenter.participantsMode == .admins { title = "admins".localized.uppercased() } else { @@ -305,7 +301,7 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol, Naviga if sender.isSelected { participantsDataSource.selectedParticipants.append(contentsOf: participants) - + } } } @@ -376,12 +372,6 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol, Naviga tableView.reloadData() avatarsView.reloadData() } - - // MARK: NavigationProtocol - func back() { - let arr:[Contact] = [] - presenter.hide(with: arr) - } } // MARK: - AddParticipantsActionsDelegate -- GitLab From d48ecff4b7c93becd2c34bc7d668d217fb54cab4 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Thu, 9 Aug 2018 13:55:28 +0300 Subject: [PATCH 23/27] Fixed NY-2331 --- Nynja/Modules/Call/CallInProgressProtocols.swift | 2 ++ .../Interactor/CallInProgressInteractor.swift | 6 ++++++ .../CallInProgress/WireFrame/CallInProgressWireframe.swift | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index 86dad4665..a3e92e39c 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -104,6 +104,8 @@ protocol CallInProgressInteractorInputProtocol: class { var presenter: CallInProgressInteractorOutputProtocol! { get set } var call: VICall? { get set } var contact: Contact? { get } + var room: Room? { get } + /** * Add here your methods for communication PRESENTER -> INTERACTOR */ diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index da01ab903..f3a59004d 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -21,6 +21,12 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, VoxServic guard let voxId = call?.voxId else { return nil } return ContactDAO.findContactBy(voxId: voxId) } + + var room: Room? { + guard let roomId = nynCall?.externalInfo else { return nil } + return RoomDAO.findRoom(by: roomId) + } + weak var nynCall: NYNCall? var duration = 0 diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift index dc68a9c63..53c92b659 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/WireFrame/CallInProgressWireframe.swift @@ -137,7 +137,7 @@ class CallInProgressWireframe: CallInProgressWireFrameProtocol { } } - AddParticipantsWireFrame().presentAddParticipants(navigation: navigation!, main: mainWF, selectedContacts: nil, delegate: external, mode: .updateGroupCall, members: members, room:self.view?.presenter.room) + AddParticipantsWireFrame().presentAddParticipants(navigation: navigation!, main: mainWF, selectedContacts: nil, delegate: external, mode: .updateGroupCall, members: members, room:self.view?.presenter.interactor.room) } func showMenuWith(participant: NYNCallParticipant?, delegate: ManageCallInProgressParticipantsProtocol) { -- GitLab From ca7f39d8ab34703847213b9de3a044c8de221f15 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Thu, 9 Aug 2018 14:04:58 +0300 Subject: [PATCH 24/27] NY-2274: iOS: Group ID is shown instead group name on incoming call screen. --- Nynja/Resources/Info.plist | 2 +- Nynja/Services/NynjaCommunicatorService.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Nynja/Resources/Info.plist b/Nynja/Resources/Info.plist index d4cb09cf4..8ee31ca43 100644 --- a/Nynja/Resources/Info.plist +++ b/Nynja/Resources/Info.plist @@ -21,7 +21,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 0.2.133 + 0.2.135 ConfServerAddress $(ConfServerAddress) ConfServerPort diff --git a/Nynja/Services/NynjaCommunicatorService.swift b/Nynja/Services/NynjaCommunicatorService.swift index 580c8c8e1..4579d5a1a 100644 --- a/Nynja/Services/NynjaCommunicatorService.swift +++ b/Nynja/Services/NynjaCommunicatorService.swift @@ -134,7 +134,8 @@ class NynjaCommunicatorService: NSObject, NynjaCommunicatorDelegate, NYNCallDele self.nynComm.getCallManager().createConference(withRequestId: creator.createId, withExternalId: UUID().uuidString, - withRequestInfo: creator.roomId) + withRequestInfo: creator.roomId, + withSubject: creator.name) } func addConferenceMember(conferenceId:String, phoneId: String, name:String) { -- GitLab From 709f01f44be51fdd7cbdd01949b263fba6a70ec8 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Thu, 9 Aug 2018 15:43:24 +0300 Subject: [PATCH 25/27] Fixed NY-2323 --- .../Views/TableView/MessageTableViewDelegate.swift | 10 +++++++++- Nynja/Resources/en.lproj/Localizable.strings | 1 + Nynja/Resources/ru.lproj/Localizable.strings | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Nynja/Modules/Message/View/Views/TableView/MessageTableViewDelegate.swift b/Nynja/Modules/Message/View/Views/TableView/MessageTableViewDelegate.swift index cad450d33..478d7105a 100644 --- a/Nynja/Modules/Message/View/Views/TableView/MessageTableViewDelegate.swift +++ b/Nynja/Modules/Message/View/Views/TableView/MessageTableViewDelegate.swift @@ -150,6 +150,14 @@ class MessageTableViewDelegate: NSObject, UITableViewDelegate, CallInfoViewDeleg // MARK: CallInfoVIewDelegate func didPressButtonJoinIn(callInfoView: CallInfoView) { - self.view?.rejoinRunningCall() + + AlertManager.sharedInstance.showAlertWithTwoActions(title: "", + message: "are_u_sure_join_the_call".localized, + firstActionTitle: "no".localized, + secondActionTitle: "yes".localized, + firstAction: nil, + secondAction: { + self.view?.rejoinRunningCall() + }) } } diff --git a/Nynja/Resources/en.lproj/Localizable.strings b/Nynja/Resources/en.lproj/Localizable.strings index 169dccef7..cc8be7412 100644 --- a/Nynja/Resources/en.lproj/Localizable.strings +++ b/Nynja/Resources/en.lproj/Localizable.strings @@ -395,6 +395,7 @@ "unblock"="Unblock"; "are_u_sure_block"="Are you sure you want to block this user?"; "are_u_sure_unblock"="Are you sure you want to unblock this user?"; +"are_u_sure_join_the_call"="Do you want to join the call?"; "send_message"="Send a message"; "add_contact"="Add to contacts"; "u_are_blocked"="You are blocked"; diff --git a/Nynja/Resources/ru.lproj/Localizable.strings b/Nynja/Resources/ru.lproj/Localizable.strings index 373cdb2c7..5babdbb26 100644 --- a/Nynja/Resources/ru.lproj/Localizable.strings +++ b/Nynja/Resources/ru.lproj/Localizable.strings @@ -360,6 +360,7 @@ "unblock"="Разблокировать"; "are_u_sure_block"="Вы уверены, что хотите заблокировать этого пользователя?"; "are_u_sure_unblock"="Вы уверены что хотите разблокировать этого пользователя?"; +"are_u_sure_join_the_call"="Вы хотите присоединиться к вызову?"; "send_message"="Отправить сообщение"; "add_contact"="Добавить в контакты"; "u_are_blocked"="Вы заблокированы"; -- GitLab From 44cdb933efe0a7620195be03d81af4a62ed4e9d3 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Thu, 9 Aug 2018 17:41:10 +0300 Subject: [PATCH 26/27] Fixed NY-1665 --- .../View/AddParticipantsViewController.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift b/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift index 729a8a7f2..3fba25e68 100644 --- a/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift +++ b/Nynja/Modules/AddParticipants/View/AddParticipantsViewController.swift @@ -199,10 +199,13 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol { doneButton.setTitle("delete".localized.uppercased(), for: .normal) } else if presenter.participantsMode == .createGroupCall { doneButton.setTitle("call".localized.uppercased(), for: .normal) + doneButton.setTitle("call".localized.uppercased(), for: .disabled) } else if presenter.participantsMode == .createConferenceCall { doneButton.setTitle("call".localized.uppercased(), for: .normal) + doneButton.setTitle("call".localized.uppercased(), for: .disabled) } else if presenter.participantsMode == .updateGroupCall { doneButton.setTitle("done".localized.uppercased(), for: .normal) + doneButton.setTitle("done".localized.uppercased(), for: .disabled) } else { doneButton.setTitle("done".localized.uppercased(), for: .normal) } @@ -210,6 +213,8 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol { doneButton.addTarget(self, action: #selector(doneTapped(_:)), for: .touchUpInside) setupTestingKeysInSubviews() + + updateDoneButtonState() } private func configureLists() { @@ -250,6 +255,13 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol { return layout } + + private func updateDoneButtonState() { + + if presenter.participantsMode == .createGroupCall || presenter.participantsMode == .updateGroupCall || presenter.participantsMode == .createConferenceCall { + doneButton.isEnabled = (participantsDataSource.selectedParticipants.count > 0) + } + } // MARK: - Actions @objc private func doneTapped(_ button: UIButton) { @@ -334,6 +346,8 @@ class AddParticipantsViewController: BaseVC, AddParticipantsViewProtocol { avatarsView.reloadData() tableView.reloadData() + + updateDoneButtonState() } // MARK: - Keyboard @@ -385,6 +399,8 @@ extension AddParticipantsViewController: ParticipantsActionsDelegate { deselectParticipant(participant) tableView.reloadData() avatarsView.reloadData() + + updateDoneButtonState() } func participantTapped(_ participant: Participant) { @@ -411,6 +427,8 @@ extension AddParticipantsViewController: ParticipantsActionsDelegate { } avatarsView.reloadData() + + updateDoneButtonState() } private func deselectParticipant(_ participant: Participant) { -- GitLab From 78edb167d7519d7e0d38f1cfc54687f588a71e17 Mon Sep 17 00:00:00 2001 From: Angel Terziev Date: Thu, 9 Aug 2018 18:37:48 +0300 Subject: [PATCH 27/27] Disabled p2p video --- Nynja.xcodeproj/project.pbxproj | 59 +++---------------- .../Main/Presenter/MainPresenter.swift | 4 +- Podfile | 2 +- 3 files changed, 11 insertions(+), 54 deletions(-) diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index bf10aee4e..86aa0f3c7 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -609,8 +609,6 @@ 5A6237362268CC9BD4792230 /* EditUsernameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B772E08B9E40EB48DD87082 /* EditUsernameViewController.swift */; }; 5AD8110B5B87B1AB9F1C5B52 /* CreateGroupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CBACEAABEE65D7EC5572C4E /* CreateGroupPresenter.swift */; }; 5B5EE777EF301CFC1FDCF307 /* CreateGroupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFC76E2B3DD0BCA0A622A5CD /* CreateGroupInteractor.swift */; }; - 5B86631B21107304005B4146 /* NynjaSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B10967F2108E797000927F4 /* NynjaSDK.framework */; }; - 5B86631C21107304005B4146 /* NynjaSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5B10967F2108E797000927F4 /* NynjaSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 5BC1D37320D3B3D9002A44B3 /* NynjaCommunicatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37220D3B3D8002A44B3 /* NynjaCommunicatorService.swift */; }; 5BC1D37920D3B4A8002A44B3 /* GroupCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37420D3B4A6002A44B3 /* GroupCollectionViewCell.swift */; }; 5BC1D37B20D3B4A8002A44B3 /* GroupAddParticipantsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BC1D37620D3B4A7002A44B3 /* GroupAddParticipantsCollectionViewCell.swift */; }; @@ -1984,13 +1982,6 @@ remoteGlobalIDString = 357809A21F9765CF00C9680C; remoteInfo = "Nynja-Share"; }; - 5B10967E2108E797000927F4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5B1096792108E797000927F4 /* sdk.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 5B87E4082088DE100063D5BB; - remoteInfo = NynjaSDK; - }; 5B80A2842102177B0008D6AD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; @@ -1998,13 +1989,6 @@ remoteGlobalIDString = 8514D4C120EE27080002378A; remoteInfo = NynjaUIKit; }; - 5B86631D21107304005B4146 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5B1096792108E797000927F4 /* sdk.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 5B87E4072088DE100063D5BB; - remoteInfo = NynjaSDK; - }; 85C65C6A20EE58ED00C468B2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; @@ -2069,7 +2053,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 5B86631C21107304005B4146 /* NynjaSDK.framework in Embed Frameworks */, 85C65C7520EE5A5A00C468B2 /* NynjaUIKit.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -2599,7 +2582,6 @@ 5957BF589EEC24E6799EB4CF /* TimeZoneSelectorViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TimeZoneSelectorViewController.swift; sourceTree = ""; }; 59C99DD8A060B0BE6802110F /* AddContactPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AddContactPresenter.swift; sourceTree = ""; }; 5AEEB3D82E9CF02760DA4CE7 /* Pods-Nynja-Share.channels.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Nynja-Share.channels.xcconfig"; path = "Pods/Target Support Files/Pods-Nynja-Share/Pods-Nynja-Share.channels.xcconfig"; sourceTree = ""; }; - 5B1096792108E797000927F4 /* sdk.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sdk.xcodeproj; path = "externals/mobile-sdk-s4/src/sdk/ios/sdk.xcodeproj"; sourceTree = ""; }; 5B377AA90A6B6BA0120C31F1 /* EditProfileProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EditProfileProtocols.swift; sourceTree = ""; }; 5BC1D37220D3B3D8002A44B3 /* NynjaCommunicatorService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NynjaCommunicatorService.swift; path = Services/NynjaCommunicatorService.swift; sourceTree = ""; }; 5BC1D37420D3B4A6002A44B3 /* GroupCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupCollectionViewCell.swift; sourceTree = ""; }; @@ -3802,7 +3784,6 @@ files = ( 85C65C7420EE5A5A00C468B2 /* NynjaUIKit.framework in Frameworks */, 63E6537BBBD814F6DF3DC589 /* Pods_Nynja.framework in Frameworks */, - 5B86631B21107304005B4146 /* NynjaSDK.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5569,7 +5550,6 @@ isa = PBXGroup; children = ( 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */, - 5B1096792108E797000927F4 /* sdk.xcodeproj */, A4A242442060370E00B0A804 /* Shared */, 3ABCE8EF1EC9330D00A80B15 /* Nynja */, 357809A41F9765CF00C9680C /* Nynja-Share */, @@ -6255,14 +6235,6 @@ path = WireFrame; sourceTree = ""; }; - 5B10967A2108E797000927F4 /* Products */ = { - isa = PBXGroup; - children = ( - 5B10967F2108E797000927F4 /* NynjaSDK.framework */, - ); - name = Products; - sourceTree = ""; - }; 5B2B64C658BEC3CCC90B0DEF /* WireFrame */ = { isa = PBXGroup; children = ( @@ -12239,7 +12211,6 @@ 264FFA921FC590580028243D /* PBXTargetDependency */, 85C65C7220EE5A2800C468B2 /* PBXTargetDependency */, 85C65C7720EE5A5A00C468B2 /* PBXTargetDependency */, - 5B86631E21107304005B4146 /* PBXTargetDependency */, ); name = Nynja; productName = Nynja; @@ -12354,10 +12325,6 @@ ProductGroup = 5B80A2812102177B0008D6AD /* Products */; ProjectRef = 85C65C6620EE58EC00C468B2 /* NynjaUIKit.xcodeproj */; }, - { - ProductGroup = 5B10967A2108E797000927F4 /* Products */; - ProjectRef = 5B1096792108E797000927F4 /* sdk.xcodeproj */; - }, ); projectRoot = ""; targets = ( @@ -12370,13 +12337,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 5B10967F2108E797000927F4 /* NynjaSDK.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = NynjaSDK.framework; - remoteRef = 5B10967E2108E797000927F4 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 5B80A2852102177B0008D6AD /* NynjaUIKit.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -12539,6 +12499,7 @@ "${BUILT_PRODUCTS_DIR}/JTAppleCalendar/JTAppleCalendar.framework", "${BUILT_PRODUCTS_DIR}/MDFTextAccessibility/MDFTextAccessibility.framework", "${BUILT_PRODUCTS_DIR}/MaterialComponents/MaterialComponents.framework", + "${PODS_ROOT}/NynjaSDK/NynjaSDK.framework", "${BUILT_PRODUCTS_DIR}/QRCode/QRCode.framework", "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", "${BUILT_PRODUCTS_DIR}/SQLCipher/SQLCipher.framework", @@ -12565,6 +12526,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JTAppleCalendar.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MDFTextAccessibility.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponents.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NynjaSDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QRCode.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLCipher.framework", @@ -14692,11 +14654,6 @@ target = 357809A21F9765CF00C9680C /* Nynja-Share */; targetProxy = 264FFA911FC590580028243D /* PBXContainerItemProxy */; }; - 5B86631E21107304005B4146 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = NynjaSDK; - targetProxy = 5B86631D21107304005B4146 /* PBXContainerItemProxy */; - }; 85C65C7220EE5A2800C468B2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = NynjaUIKit; @@ -15143,7 +15100,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Nynja-Share/Resources/Nynja-Share.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 9GKQ5AMF2B; @@ -15155,8 +15112,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -DSHARE_EXTENSION"; PRODUCT_BUNDLE_IDENTIFIER = "$(ExtensionBundleIdentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "99725127-a6e8-4f22-98eb-18164dfae6db"; - PROVISIONING_PROFILE_SPECIFIER = DevBundle_AdHocExt; + PROVISIONING_PROFILE = "3d8b88dd-22c4-457b-864c-32d6378f5f64"; + PROVISIONING_PROFILE_SPECIFIER = DevBundle_DevExt; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -15318,7 +15275,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Nynja/Resources/Nynja.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 9GKQ5AMF2B; @@ -15328,8 +15285,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "$(BundleIdentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "50dd2a41-0a8c-4a0a-a8b9-744fa4bf3bb4"; - PROVISIONING_PROFILE_SPECIFIER = DevBundle_adhoc; + PROVISIONING_PROFILE = "8a9243cd-515b-4739-b9d6-f73ba97c3403"; + PROVISIONING_PROFILE_SPECIFIER = DevBundle_Dev; SWIFT_OBJC_BRIDGING_HEADER = "Nynja-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; diff --git a/Nynja/Modules/Main/Presenter/MainPresenter.swift b/Nynja/Modules/Main/Presenter/MainPresenter.swift index 3ae063335..374f50643 100644 --- a/Nynja/Modules/Main/Presenter/MainPresenter.swift +++ b/Nynja/Modules/Main/Presenter/MainPresenter.swift @@ -65,8 +65,8 @@ class MainPresenter: MainPresenterProtocol, MainInteractorOutputProtocol, Schedu } func videoCall() { - self.wireFrame.isGroup = false - self.performVideoCall() + self.wireFrame.showNotImplementedAlert() + //TODO: To enable video call performVideoCall() } func videoGroupCall() { diff --git a/Podfile b/Podfile index 8ed5bea15..b198b57c0 100644 --- a/Podfile +++ b/Podfile @@ -40,7 +40,7 @@ def commonPodsForNynja pod 'MaterialComponents/FlexibleHeader' pod 'JTAppleCalendar', '~> 7.0' - #pod 'NynjaSDK', '~> 1.3.3' + pod 'NynjaSDK', '~> 1.4.0' pod 'CryptoSwift' end -- GitLab