From b17f49c9d8c91a3cba6760b5c04e91cb9c5a6682 Mon Sep 17 00:00:00 2001 From: Gabriel Radu Date: Wed, 23 Aug 2023 17:27:50 +0200 Subject: [PATCH] Fix warning about needing to instantiate on main For iOS we are now indicating through `requiresMainQueueSetup()` returning false that modules do not need to be instantiated on the main thread. --- ios/Services/AudioService/AudioPreviewServiceModule.swift | 6 +++++- ios/Services/AudioService/LocalAudioServiceModule.swift | 4 ++++ ios/Services/AudioService/RemoteAudioServiceModule.swift | 4 ++++ ios/Services/CommandService/CommandServiceModule.swift | 4 ++++ ios/Services/CommsAPIModule.swift | 4 ++++ .../ConferenceService/ConferenceServiceModule.swift | 5 +++++ .../FilePresentationServiceModule.swift | 4 ++++ .../MediaDeviceService/MediaDeviceServiceModule.swift | 4 ++++ .../NotificationService/NotificationServiceModule.swift | 4 ++++ ios/Services/RecordingService/RecordingServiceModule.swift | 4 ++++ ios/Services/SessionService/SessionServiceModule.swift | 4 ++++ .../VideoPresentationServiceModule.swift | 4 ++++ ios/Services/VideoService/LocalVideoServiceModule.swift | 4 ++++ ios/Services/VideoService/RemoteVideoServiceModule.swift | 4 ++++ 14 files changed, 58 insertions(+), 1 deletion(-) diff --git a/ios/Services/AudioService/AudioPreviewServiceModule.swift b/ios/Services/AudioService/AudioPreviewServiceModule.swift index fb4ab237..357c63b4 100644 --- a/ios/Services/AudioService/AudioPreviewServiceModule.swift +++ b/ios/Services/AudioService/AudioPreviewServiceModule.swift @@ -3,7 +3,11 @@ import VoxeetSDK @objc(RNAudioPreviewServiceModule) public class AudioPreviewServiceModule: ReactEmitter { - + + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + public override init() { super.init() VoxeetSDK.shared.audio.local.preview.onStatusChanged diff --git a/ios/Services/AudioService/LocalAudioServiceModule.swift b/ios/Services/AudioService/LocalAudioServiceModule.swift index c144f34d..f40df43d 100644 --- a/ios/Services/AudioService/LocalAudioServiceModule.swift +++ b/ios/Services/AudioService/LocalAudioServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNLocalAudioServiceModule) public class LocalAudioServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// Returns the local participant's audio capture mode in Dolby Voice conferences. /// - Parameters: /// - resolve: returns ComfortNoiseLevel on success diff --git a/ios/Services/AudioService/RemoteAudioServiceModule.swift b/ios/Services/AudioService/RemoteAudioServiceModule.swift index 2ef5875c..76c5addb 100644 --- a/ios/Services/AudioService/RemoteAudioServiceModule.swift +++ b/ios/Services/AudioService/RemoteAudioServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNRemoteAudioServiceModule) public class RemoteAudioServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// Allows the local participant to unmute a specific remote participant who is locally muted through the stop method. /// - Parameters: /// - participant: The selected remote participant who is locally muted through the stop method. diff --git a/ios/Services/CommandService/CommandServiceModule.swift b/ios/Services/CommandService/CommandServiceModule.swift index c1140770..3eceb952 100644 --- a/ios/Services/CommandService/CommandServiceModule.swift +++ b/ios/Services/CommandService/CommandServiceModule.swift @@ -9,6 +9,10 @@ private enum EventKeys: String, CaseIterable { @objc(RNCommandServiceModule) public class CommandServiceModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + // MARK: - Events Setup @objc(supportedEvents) override public func supportedEvents() -> [String] { diff --git a/ios/Services/CommsAPIModule.swift b/ios/Services/CommsAPIModule.swift index d176d69d..db0c0e67 100644 --- a/ios/Services/CommsAPIModule.swift +++ b/ios/Services/CommsAPIModule.swift @@ -12,6 +12,10 @@ private let sdkVersion = "3.10.1" @objc(RNCommsAPIModule) public class CommsAPIModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + private var refreshToken: ((String?) -> Void)? // MARK: - Events Setup diff --git a/ios/Services/ConferenceService/ConferenceServiceModule.swift b/ios/Services/ConferenceService/ConferenceServiceModule.swift index f77b400a..da4890f8 100644 --- a/ios/Services/ConferenceService/ConferenceServiceModule.swift +++ b/ios/Services/ConferenceService/ConferenceServiceModule.swift @@ -21,6 +21,11 @@ private enum EventKeys: String, CaseIterable { @objc(RNConferenceServiceModule) public class ConferenceServiceModule: ReactEmitter { + + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + var current: VTConference? { VoxeetSDK.shared.conference.current } diff --git a/ios/Services/FilePresentationService/FilePresentationServiceModule.swift b/ios/Services/FilePresentationService/FilePresentationServiceModule.swift index 2d8f6451..888baa36 100644 --- a/ios/Services/FilePresentationService/FilePresentationServiceModule.swift +++ b/ios/Services/FilePresentationService/FilePresentationServiceModule.swift @@ -16,6 +16,10 @@ private enum EventKeys: String, CaseIterable { @objc(RNFilePresentationServiceModule) public class FilePresentationServiceModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + @Atomic private var fileConvertedCache: [String: VTFileConverted] = [:] diff --git a/ios/Services/MediaDeviceService/MediaDeviceServiceModule.swift b/ios/Services/MediaDeviceService/MediaDeviceServiceModule.swift index 209237e1..48553ff3 100644 --- a/ios/Services/MediaDeviceService/MediaDeviceServiceModule.swift +++ b/ios/Services/MediaDeviceService/MediaDeviceServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNMediaDeviceServiceModule) public class MediaDeviceServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// Changes the device camera (front or back). /// - Parameters: /// - resolve: returns on success diff --git a/ios/Services/NotificationService/NotificationServiceModule.swift b/ios/Services/NotificationService/NotificationServiceModule.swift index 475eba5a..ab367150 100644 --- a/ios/Services/NotificationService/NotificationServiceModule.swift +++ b/ios/Services/NotificationService/NotificationServiceModule.swift @@ -16,6 +16,10 @@ private enum EventKeys: String, CaseIterable { @objc(RNNotificationServiceModule) public class NotificationServiceModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + // MARK: - Events Setup @objc(supportedEvents) override public func supportedEvents() -> [String] { diff --git a/ios/Services/RecordingService/RecordingServiceModule.swift b/ios/Services/RecordingService/RecordingServiceModule.swift index 1e9fe393..03b1b8f7 100644 --- a/ios/Services/RecordingService/RecordingServiceModule.swift +++ b/ios/Services/RecordingService/RecordingServiceModule.swift @@ -10,6 +10,10 @@ private enum EventKeys: String, CaseIterable { @objc(RNRecordingServiceModule) public class RecordingServiceModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + @Atomic private var currentRecording: RecordingModel? diff --git a/ios/Services/SessionService/SessionServiceModule.swift b/ios/Services/SessionService/SessionServiceModule.swift index 695c7ba2..5c04a20f 100644 --- a/ios/Services/SessionService/SessionServiceModule.swift +++ b/ios/Services/SessionService/SessionServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNSessionServiceModule) public class SessionServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// Opens a new session. /// - Parameters: /// - userInfo: user info diff --git a/ios/Services/VideoPresentationService/VideoPresentationServiceModule.swift b/ios/Services/VideoPresentationService/VideoPresentationServiceModule.swift index 7e762d57..04081183 100644 --- a/ios/Services/VideoPresentationService/VideoPresentationServiceModule.swift +++ b/ios/Services/VideoPresentationService/VideoPresentationServiceModule.swift @@ -18,6 +18,10 @@ private enum EventKeys: String, CaseIterable { @objc(RNVideoPresentationServiceModule) public class VideoPresentationServiceModule: ReactEmitter { + @objc public override static func requiresMainQueueSetup() -> Bool { + return false + } + // MARK: - Events Setup @objc(supportedEvents) override public func supportedEvents() -> [String] { diff --git a/ios/Services/VideoService/LocalVideoServiceModule.swift b/ios/Services/VideoService/LocalVideoServiceModule.swift index 5c945efd..2d5a2413 100644 --- a/ios/Services/VideoService/LocalVideoServiceModule.swift +++ b/ios/Services/VideoService/LocalVideoServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNLocalVideoServiceModule) public class LocalVideoServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// Enables the local participant's video and sends the video to a conference. /// - Parameters: /// - resolve: returns on success diff --git a/ios/Services/VideoService/RemoteVideoServiceModule.swift b/ios/Services/VideoService/RemoteVideoServiceModule.swift index 1fb35c4a..ea908f76 100644 --- a/ios/Services/VideoService/RemoteVideoServiceModule.swift +++ b/ios/Services/VideoService/RemoteVideoServiceModule.swift @@ -4,6 +4,10 @@ import VoxeetSDK @objc(RNRemoteVideoServiceModule) public class RemoteVideoServiceModule: NSObject { + @objc public static func requiresMainQueueSetup() -> Bool { + return false + } + /// If the local participant used the stop method to stop receiving video streams from selected remote participants. /// - Parameters: /// - participant: The selected remote participant who is locally muted through the stop method.