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

Commit

Permalink
Fixing method override issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jun 15, 2020
1 parent 3473f71 commit 6528ac3
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions ios/BLEAdvertiser.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,6 @@ - (dispatch_queue_t)methodQueue
resolve(@"Stopping Broadcast");
}

RCT_EXPORT_METHOD(scan: (NSString *)uid payload:(NSArray *)payload options:(NSDictionary *)options
resolve: (RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject){

if (!centralManager) { reject(@"Device does not support Bluetooth", @"Adapter is Null", nil); return; }

switch (centralManager.state) {
case CBManagerStatePoweredOn: break;
case CBManagerStatePoweredOff: reject(@"Bluetooth not ON",@"Powered off", nil); return;
case CBManagerStateResetting: reject(@"Bluetooth not ON",@"Resetting", nil); return;
case CBManagerStateUnauthorized: reject(@"Bluetooth not ON",@"Unauthorized", nil); return;
case CBManagerStateUnknown: reject(@"Bluetooth not ON",@"Unknown", nil); return;
case CBManagerStateUnsupported: reject(@"STATE_OFF",@"Unsupported", nil); return;
}

if ([uid length] > 0) {
[centralManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:uid]] options:@{CBCentralManagerScanOptionAllowDuplicatesKey:[NSNumber numberWithBool:YES]}];
} else {
[centralManager scanForPeripheralsWithServices:nil options:@{CBCentralManagerScanOptionAllowDuplicatesKey:[NSNumber numberWithBool:YES]}];
}

resolve(@"Scanning Started");
}


RCT_EXPORT_METHOD(scan: (NSArray *)payload options:(NSDictionary *)options
resolve: (RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject){
Expand Down

0 comments on commit 6528ac3

Please sign in to comment.