Skip to content

Commit

Permalink
fix: requires main queue setup warning on iOS (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeckers authored Feb 16, 2021
1 parent f438e45 commit 5361a3f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/BlobCourier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import Foundation

@objc(BlobCourier)
open class BlobCourier: NSObject {
@objc static func requiresMainQueueSetup() -> Bool {
return false
}

@objc(fetchBlob:withResolver:withRejecter:)
func fetchBlob(
input: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
Expand Down
9 changes: 9 additions & 0 deletions ios/BlobCourierTests/BlobCourierTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,13 @@ class BlobCourierTests: XCTestCase {
DispatchTimeInterval.seconds(BlobCourierTests.defaultPromiseTimeoutSeconds))
XCTAssertTrue(result.0)
}

func testMainQueueSetupIsNotRequired() throws {
let blobCourierResult = BlobCourier.requiresMainQueueSetup()
let blobCourierEventEmitterResult = BlobCourierEventEmitter.requiresMainQueueSetup()

XCTAssertFalse(blobCourierResult)
XCTAssertFalse(blobCourierEventEmitterResult)
}

}
4 changes: 4 additions & 0 deletions ios/React/BlobCourierEventEmitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ open class BlobCourierEventEmitter: RCTEventEmitter {

public static var shared: BlobCourierEventEmitter?

@objc public override static func requiresMainQueueSetup() -> Bool {
return false
}

override init() {
super.init()

Expand Down

0 comments on commit 5361a3f

Please sign in to comment.