Skip to content

Commit

Permalink
Merge pull request #1317 from CptFabulouso/v11-expose-native-methods
Browse files Browse the repository at this point in the history
feat(v11): Expose getCentralManager and getInstance methods
  • Loading branch information
marcosinigaglia authored Jan 16, 2025
2 parents 35bde31 + 5c4a194 commit 36a585c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ios/BleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@
#import "React/RCTEventEmitter.h"
#import <CoreBluetooth/CoreBluetooth.h>

NS_ASSUME_NONNULL_BEGIN

@interface BleManager : RCTEventEmitter <RCTBridgeModule, CBCentralManagerDelegate>

+ (nullable CBCentralManager *)getCentralManager;
+ (nullable BleManager *)getInstance;

@end

NS_ASSUME_NONNULL_END
4 changes: 2 additions & 2 deletions ios/BleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1193,11 +1193,11 @@ class BleManager: RCTEventEmitter, CBCentralManagerDelegate, CBPeripheralDelegat
}


static func getCentralManager() -> CBCentralManager? {
@objc static func getCentralManager() -> CBCentralManager? {
return sharedManager
}

static func getInstance() -> BleManager? {
@objc static func getInstance() -> BleManager? {
return shared
}

Expand Down

0 comments on commit 36a585c

Please sign in to comment.