Skip to content

Commit 22514db

Browse files
committed
Disallow bluetooth request in simulator
1 parent 873052f commit 22514db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ - (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
5757

5858
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
5959
rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
60+
#if TARGET_OS_SIMULATOR
61+
return resolve(RNPermissionStatusNotAvailable);
62+
#else
6063
_resolve = resolve;
6164
_reject = reject;
6265

@@ -65,6 +68,7 @@ - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
6568
}];
6669

6770
[_peripheralManager startAdvertising:@{}];
71+
#endif
6872
}
6973

7074
- (void)peripheralManagerDidUpdateState:(nonnull CBPeripheralManager *)peripheral {

0 commit comments

Comments
 (0)