Skip to content

Commit

Permalink
Configure method queue (#28)
Browse files Browse the repository at this point in the history
Configure method queue
  • Loading branch information
christophermark authored Oct 14, 2019
2 parents db9f1a6 + 4e27164 commit 834e139
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 1 addition & 4 deletions ios/ScreenBrightness/ScreenBrightness.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#if __has_include(<React/RCTBridgeModule.H>)
#import <React/RCTBridgeModule.h>
#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#else
#import "RCTBridgeModule.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#endif

@interface ScreenBrightness : NSObject<RCTBridgeModule>
Expand Down
16 changes: 10 additions & 6 deletions ios/ScreenBrightness/ScreenBrightness.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
//

#import "ScreenBrightness.h"
#if __has_include(<React/RCTBridgeModule.H>)
#else
#import "RCTBridgeModule.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#endif

@implementation ScreenBrightness

RCT_EXPORT_MODULE();

+ (BOOL)requiresMainQueueSetup
{
return NO;
}

- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}

RCT_EXPORT_METHOD(getBrightness:(RCTPromiseResolveBlock)resolve
getScreenBrightnessRejector:(RCTPromiseRejectBlock)reject) {

Expand Down

0 comments on commit 834e139

Please sign in to comment.