From fbb4c4602f002879002ae0aeeff47931b7589ea7 Mon Sep 17 00:00:00 2001 From: Siva N Date: Fri, 3 Nov 2023 19:31:43 +0530 Subject: [PATCH] #v5.13.2 - Release Revoke admin in Group has been newly introduced in SDK. You can revoke a admin user from a group to a normal user if you are an admin in that group using the method GroupManager.shared.revokeAdmin(groupJid: groupID, revokeAdminJid: userJid). --- MirrorflyShareKit/ShareKitViewModel.swift | 3 +- .../SharekitShareToViewController.swift | 2 +- MirrorflyUIkit.xcodeproj/project.pbxproj | 2 + .../MirrorflyNotificationExtention.xcscheme | 1 + .../xcschemes/MirrorflyShareKit.xcscheme | 96 +++++++++++++++++++ .../xcschemes/UikitQaShareKit.xcscheme | 1 + .../Chat/ChatViewParentController.swift | 4 +- ...nstantScheduledMeetingViewController.swift | 2 +- .../Controllers/Delegates/AppDelegate.swift | 2 +- .../ForwardViewController.swift | 2 +- .../Image/ImageEditController.swift | 2 +- .../RecentChat/RecentChatViewController.swift | 2 +- .../GroupInfoOptionsViewController.swift | 3 +- .../Controller/GroupInfoViewController.swift | 14 ++- .../Controller/GroupInfoViewModel.swift | 7 +- .../Plist/MirrorflyUIkit-info.plist | 4 +- .../group/GroupCreationViewModel.swift | 10 +- .../AddParticipantsViewController.swift | 7 +- .../NotificationService.swift | 3 +- Podfile | 4 +- 20 files changed, 140 insertions(+), 31 deletions(-) create mode 100644 MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/MirrorflyShareKit.xcscheme diff --git a/MirrorflyShareKit/ShareKitViewModel.swift b/MirrorflyShareKit/ShareKitViewModel.swift index ca34d7f..2b83a87 100644 --- a/MirrorflyShareKit/ShareKitViewModel.swift +++ b/MirrorflyShareKit/ShareKitViewModel.swift @@ -15,11 +15,12 @@ import Contacts let BASE_URL = "https://api-preprod-sandbox.mirrorfly.com/api/v1/" let CONTAINER_ID = "group.com.mirrorfly.qa" -let LICENSE_KEY = "xxxxxxxxxxxxxxxx" +let LICENSE_KEY = "XXXXXXXXXXXXXX" let IS_LIVE = false let APP_NAME = "UiKit" let ENABLE_CONTACT_SYNC = false + protocol ShareKitDelegate { func removeData() } diff --git a/MirrorflyShareKit/ShareScreen/SharekitShareToViewController.swift b/MirrorflyShareKit/ShareScreen/SharekitShareToViewController.swift index 0390df0..43a7a71 100755 --- a/MirrorflyShareKit/ShareScreen/SharekitShareToViewController.swift +++ b/MirrorflyShareKit/ShareScreen/SharekitShareToViewController.swift @@ -1363,7 +1363,7 @@ func userUpdatedTheirProfile(for jid: String, profileDetails: ProfileDetails) { } extension SharekitShareToViewController : GroupEventsDelegate { - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { } func didAddNewMemeberToGroup(groupJid: String, newMemberJid: String, addedByMemberJid: String) { diff --git a/MirrorflyUIkit.xcodeproj/project.pbxproj b/MirrorflyUIkit.xcodeproj/project.pbxproj index b9da403..e95fbc6 100644 --- a/MirrorflyUIkit.xcodeproj/project.pbxproj +++ b/MirrorflyUIkit.xcodeproj/project.pbxproj @@ -858,6 +858,7 @@ CEB66AC929AE2DC90084559C /* ShareKitShareViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareKitShareViewModel.swift; sourceTree = ""; }; CEBE3BD82959CF1F004E7C49 /* FooterSectionCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FooterSectionCell.xib; sourceTree = ""; }; CEC08B6127E23B0D005E48C5 /* Mirrorfly-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Mirrorfly-Info.plist"; path = "/Users/user/Desktop/UiKit/Mirrorfly-Info.plist"; sourceTree = ""; }; + CEC08B7227E23B9F005E48C5 /* MirrorflyNotificationExtention-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "MirrorflyNotificationExtention-Info.plist"; path = "/Users/user/Desktop/UiKit/MirrorflyNotificationExtention-Info.plist"; sourceTree = ""; }; CEC08B7427E243D9005E48C5 /* MirrorflyNotificationextention.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = MirrorflyNotificationextention.entitlements; sourceTree = ""; }; CEC08B7E27E24F41005E48C5 /* GoogleService-Qa-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Qa-Info.plist"; sourceTree = ""; }; CEC2D48827A5AAA700AB107A /* ContactInfoViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactInfoViewModel.swift; sourceTree = ""; }; @@ -2692,6 +2693,7 @@ CEC08B7427E243D9005E48C5 /* MirrorflyNotificationextention.entitlements */, CEF43750273BCAB2008D0F39 /* NotificationExtentionQa.entitlements */, CEF43746273BCA77008D0F39 /* NotificationService.swift */, + CEC08B7227E23B9F005E48C5 /* MirrorflyNotificationExtention-Info.plist */, CEF43748273BCA77008D0F39 /* Info.plist */, ); path = NotificationExtention; diff --git a/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/MirrorflyNotificationExtention.xcscheme b/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/MirrorflyNotificationExtention.xcscheme index 78663d9..c6b90e2 100644 --- a/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/MirrorflyNotificationExtention.xcscheme +++ b/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/MirrorflyNotificationExtention.xcscheme @@ -49,6 +49,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/UikitQaShareKit.xcscheme b/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/UikitQaShareKit.xcscheme index dae6a9f..e011cbf 100644 --- a/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/UikitQaShareKit.xcscheme +++ b/MirrorflyUIkit.xcodeproj/xcshareddata/xcschemes/UikitQaShareKit.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/MirrorflyUIkit/Chat/ChatViewParentController.swift b/MirrorflyUIkit/Chat/ChatViewParentController.swift index c8405bd..3f508ee 100755 --- a/MirrorflyUIkit/Chat/ChatViewParentController.swift +++ b/MirrorflyUIkit/Chat/ChatViewParentController.swift @@ -7015,8 +7015,8 @@ extension ChatViewParentController : GroupEventsDelegate { } - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { - + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { + checkMemberOfGroup() } func didDeleteGroupLocally(groupJid: String) { diff --git a/MirrorflyUIkit/Chat/ScheduledMeeting/InstantScheduledMeetingViewController.swift b/MirrorflyUIkit/Chat/ScheduledMeeting/InstantScheduledMeetingViewController.swift index 105b1b7..3d16eca 100644 --- a/MirrorflyUIkit/Chat/ScheduledMeeting/InstantScheduledMeetingViewController.swift +++ b/MirrorflyUIkit/Chat/ScheduledMeeting/InstantScheduledMeetingViewController.swift @@ -304,7 +304,7 @@ extension InstantScheduledMeetingViewController : GroupEventsDelegate { } - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { } diff --git a/MirrorflyUIkit/Controllers/Delegates/AppDelegate.swift b/MirrorflyUIkit/Controllers/Delegates/AppDelegate.swift index dd148a5..132aefd 100755 --- a/MirrorflyUIkit/Controllers/Delegates/AppDelegate.swift +++ b/MirrorflyUIkit/Controllers/Delegates/AppDelegate.swift @@ -21,7 +21,7 @@ import AVFoundation import MirrorFlySDK let BASE_URL = "https://api-preprod-sandbox.mirrorfly.com/api/v1/" -let LICENSE_KEY = "xxxxxxxxxxxxxxxx" +let LICENSE_KEY = "XXXXXXXXXXXXXX" let XMPP_DOMAIN = "xmpp-preprod-sandbox.mirrorfly.com" let XMPP_PORT = 5222 let SOCKETIO_SERVER_HOST = "https://signal-preprod-sandbox.mirrorfly.com" diff --git a/MirrorflyUIkit/Controllers/ForwardMessages/ForwardViewController.swift b/MirrorflyUIkit/Controllers/ForwardMessages/ForwardViewController.swift index 4da696c..530928d 100755 --- a/MirrorflyUIkit/Controllers/ForwardMessages/ForwardViewController.swift +++ b/MirrorflyUIkit/Controllers/ForwardMessages/ForwardViewController.swift @@ -1142,7 +1142,7 @@ func userUpdatedTheirProfile(for jid: String, profileDetails: ProfileDetails) { } extension ForwardViewController : GroupEventsDelegate { - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { } func didAddNewMemeberToGroup(groupJid: String, newMemberJid: String, addedByMemberJid: String) { diff --git a/MirrorflyUIkit/Controllers/Image/ImageEditController.swift b/MirrorflyUIkit/Controllers/Image/ImageEditController.swift index bd1f9d5..a281022 100755 --- a/MirrorflyUIkit/Controllers/Image/ImageEditController.swift +++ b/MirrorflyUIkit/Controllers/Image/ImageEditController.swift @@ -1112,7 +1112,7 @@ extension ImageEditController: GroupEventsDelegate { } - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { } diff --git a/MirrorflyUIkit/Controllers/RecentChat/RecentChatViewController.swift b/MirrorflyUIkit/Controllers/RecentChat/RecentChatViewController.swift index 11b0667..6c16cee 100755 --- a/MirrorflyUIkit/Controllers/RecentChat/RecentChatViewController.swift +++ b/MirrorflyUIkit/Controllers/RecentChat/RecentChatViewController.swift @@ -2512,7 +2512,7 @@ extension RecentChatViewController : GroupCreationDelegate { } extension RecentChatViewController : GroupEventsDelegate { - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { DispatchQueue.main.async { [weak self] in self?.updateGroupInRecentChat(groupJid: groupJid) } diff --git a/MirrorflyUIkit/Group Info Options/Controller/GroupInfoOptionsViewController.swift b/MirrorflyUIkit/Group Info Options/Controller/GroupInfoOptionsViewController.swift index 93dec75..b311415 100644 --- a/MirrorflyUIkit/Group Info Options/Controller/GroupInfoOptionsViewController.swift +++ b/MirrorflyUIkit/Group Info Options/Controller/GroupInfoOptionsViewController.swift @@ -17,8 +17,9 @@ class GroupInfoOptions { } } -protocol GroupInfoOptionsDelegate: class { +protocol GroupInfoOptionsDelegate: AnyObject { func makeGroupAdmin(groupID: String, userJid: String, userName: String) + func removeGroupAdmin(groupID: String, userJid: String, userName: String) func removeParticipant(groupID: String, removeGroupMemberJid: String, userName: String) func navigateToUserProfile(userJid: String) func navigateToChat(userJid: String) diff --git a/MirrorflyUIkit/Group Info/Controller/GroupInfoViewController.swift b/MirrorflyUIkit/Group Info/Controller/GroupInfoViewController.swift index ea5faf9..413653c 100644 --- a/MirrorflyUIkit/Group Info/Controller/GroupInfoViewController.swift +++ b/MirrorflyUIkit/Group Info/Controller/GroupInfoViewController.swift @@ -753,6 +753,10 @@ extension GroupInfoViewController: AddParticipantsDelegate { } extension GroupInfoViewController: GroupInfoOptionsDelegate { + func removeGroupAdmin(groupID: String, userJid: String, userName: String) { + + } + func makeGroupAdmin(groupID: String, userJid: String, userName: String) { @@ -804,12 +808,16 @@ extension GroupInfoViewController: GroupInfoOptionsDelegate { AppAlert.shared.onAlertAction = { [weak self] (result) -> Void in let isBlocked = self?.groupInfoViewModel.isBlockedByAdmin(groupJid: self?.groupID ?? "") ?? false if result == 0 && !isBlocked { - self?.groupInfoViewModel.removeParticipantFromGroup(groupID: groupID, removeGroupMemberJid: removeGroupMemberJid) { [weak self] success in + self?.groupInfoViewModel.removeParticipantFromGroup(groupID: groupID, removeGroupMemberJid: removeGroupMemberJid) { [weak self] success,FlyError,data in if self?.isAdminMember == true { if success { self?.getGroupMembers() self?.refreshData() AppAlert.shared.showToast(message: removeUserStatus) + } else { + self?.getGroupMembers() + self?.refreshData() + AppAlert.shared.showToast(message: FlyError?.description ?? "") } } else { self?.getGroupMembers() @@ -965,8 +973,8 @@ extension GroupInfoViewController : GroupEventsDelegate { tableView.reloadSections(IndexSet(integer: 3), with: .none) } - func didRemoveMemberFromAdmin(groupJid: String, removedAdminMemberJid: String, removedByMemberJid: String) { - if let row = self.groupMembers.firstIndex(where: {$0.memberJid == removedAdminMemberJid}) { + func didRevokedAdminAccess(groupJid: String, revokedAdminMemberJid: String, revokedByMemberJid: String) { + if let row = self.groupMembers.firstIndex(where: {$0.memberJid == revokedAdminMemberJid}) { groupMembers[row].isAdminMember = false } tableView.reloadSections(IndexSet(integer: 3), with: .none) diff --git a/MirrorflyUIkit/Group Info/Controller/GroupInfoViewModel.swift b/MirrorflyUIkit/Group Info/Controller/GroupInfoViewModel.swift index d0ceb6b..3bb17d3 100644 --- a/MirrorflyUIkit/Group Info/Controller/GroupInfoViewModel.swift +++ b/MirrorflyUIkit/Group Info/Controller/GroupInfoViewModel.swift @@ -56,13 +56,12 @@ class GroupInfoViewModel: NSObject { } } + func removeParticipantFromGroup(groupID: String, removeGroupMemberJid: String, - completionHandler: @escaping (Bool) -> Void) { + completionHandler: @escaping FlyCompletionHandler) { try! GroupManager.shared.removeParticipantFromGroup(groupId: groupID, - removeGroupMemberJid: removeGroupMemberJid) { isSuccess, error, data in - completionHandler(isSuccess) - } + removeGroupMemberJid: removeGroupMemberJid, completionHandler: completionHandler) } func removeGroupProfileImage(groupID: String, completionHandler: @escaping(_ isSuccess: Bool, diff --git a/MirrorflyUIkit/Plist/MirrorflyUIkit-info.plist b/MirrorflyUIkit/Plist/MirrorflyUIkit-info.plist index 2e29886..eb66d08 100755 --- a/MirrorflyUIkit/Plist/MirrorflyUIkit-info.plist +++ b/MirrorflyUIkit/Plist/MirrorflyUIkit-info.plist @@ -49,7 +49,7 @@ SF-UI-Display-Heavy.otf googleApiKey - xxxx + XXXXXXXXXXXXXX LSApplicationQueriesSchemes comgooglemaps @@ -157,6 +157,6 @@ UIUserInterfaceStyle Light googleApiKey_Translation - xxxx + XXXXXXXXXXXXXX diff --git a/MirrorflyUIkit/group/GroupCreationViewModel.swift b/MirrorflyUIkit/group/GroupCreationViewModel.swift index d9655dd..2caa620 100755 --- a/MirrorflyUIkit/group/GroupCreationViewModel.swift +++ b/MirrorflyUIkit/group/GroupCreationViewModel.swift @@ -99,16 +99,10 @@ class GroupCreationViewModel : NSObject { } func addNewParticipantToGroup(groupID: String, - completionHandler: @escaping (Bool) -> Void) { + completionHandler: @escaping FlyCompletionHandler) { let contactList = getParticiapntsJID() - try! GroupManager.shared.addParticipantToGroup(groupId: groupID, newUserJidList: contactList) { isSuccess, error, data in - - if isSuccess { - print("SUCCESSSS") - } - completionHandler(isSuccess) - } + try! GroupManager.shared.addParticipantToGroup(groupId: groupID, newUserJidList: contactList, completionHandler: completionHandler) } } diff --git a/MirrorflyUIkit/group/addParticipants/AddParticipantsViewController.swift b/MirrorflyUIkit/group/addParticipants/AddParticipantsViewController.swift index ab336ee..b55a1de 100755 --- a/MirrorflyUIkit/group/addParticipants/AddParticipantsViewController.swift +++ b/MirrorflyUIkit/group/addParticipants/AddParticipantsViewController.swift @@ -151,12 +151,17 @@ class AddParticipantsViewController: UIViewController { AppAlert.shared.showToast(message: "Please select minimum one Participant") return } - groupCreationViewModel.addNewParticipantToGroup(groupID: groupID) { [weak self] success in + groupCreationViewModel.addNewParticipantToGroup(groupID: groupID) { [weak self] success,error,data in if success { self?.groupCreationViewModel.initializeGroupCreationData() self?.navigationController?.popViewController(animated: true) self?.delegate?.updatedAddParticipants() AppAlert.shared.showToast(message: "Members added successfully") + } else { + self?.groupCreationViewModel.initializeGroupCreationData() + self?.navigationController?.popViewController(animated: true) + self?.delegate?.updatedAddParticipants() + AppAlert.shared.showToast(message: error?.errorDescription ?? "") } } diff --git a/NotificationExtention/NotificationService.swift b/NotificationExtention/NotificationService.swift index 0b3782e..bf8e629 100755 --- a/NotificationExtention/NotificationService.swift +++ b/NotificationExtention/NotificationService.swift @@ -12,11 +12,12 @@ import MirrorFlySDK let BASE_URL = "https://api-preprod-sandbox.mirrorfly.com/api/v1/" let CONTAINER_ID = "group.com.mirrorfly.qa" -let LICENSE_KEY = "xxxxxxxxxxxxxxxx" +let LICENSE_KEY = "XXXXXXXXXXXXXX" let IS_LIVE = false let APP_NAME = "UiKit" let ENABLE_CONTACT_SYNC = false + let isHideNotificationContent = false class NotificationService: UNNotificationServiceExtension { diff --git a/Podfile b/Podfile index 5dd67c0..5b3a54b 100755 --- a/Podfile +++ b/Podfile @@ -31,13 +31,13 @@ def uikit_pods pod 'lottie-ios' pod 'BottomSheet', :git => 'https://github.com/joomcode/BottomSheet' - pod 'MirrorFlySDK', '5.13.0' + pod 'MirrorFlySDK', '5.13.2' end def notification_pods - pod 'MirrorFlySDK', '5.13.0' + pod 'MirrorFlySDK', '5.13.2' end