Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Fix warning about needing to instantiate on main (#267)
Browse files Browse the repository at this point in the history
For iOS we are now indicating through `requiresMainQueueSetup()`
returning false that modules do not need to be instantiated on the main
thread.
  • Loading branch information
graduad authored Aug 25, 2023
1 parent b7bfc96 commit 895b51e
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/Services/AudioService/AudioPreviewServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/AudioService/LocalAudioServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/AudioService/RemoteAudioServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/CommandService/CommandServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/CommsAPIModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ios/Services/ConferenceService/ConferenceServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [:]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/RecordingService/RecordingServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
4 changes: 4 additions & 0 deletions ios/Services/SessionService/SessionServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/VideoService/LocalVideoServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ios/Services/VideoService/RemoteVideoServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 895b51e

Please sign in to comment.