Skip to content

Commit 5f4ca4d

Browse files
committed
Fix Bluetooth API MISUSE error on iOS 12
1 parent 27f548b commit 5f4ca4d

File tree

4 files changed

+36
-40
lines changed

4 files changed

+36
-40
lines changed

example/ios/Podfile.lock

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,35 @@ PODS:
7070
- OpenSSL-Universal (1.0.2.19):
7171
- OpenSSL-Universal/Static (= 1.0.2.19)
7272
- OpenSSL-Universal/Static (1.0.2.19)
73-
- Permission-BluetoothPeripheral (2.1.4):
73+
- Permission-BluetoothPeripheral (2.1.5):
7474
- RNPermissions
75-
- Permission-Calendars (2.1.4):
75+
- Permission-Calendars (2.1.5):
7676
- RNPermissions
77-
- Permission-Camera (2.1.4):
77+
- Permission-Camera (2.1.5):
7878
- RNPermissions
79-
- Permission-Contacts (2.1.4):
79+
- Permission-Contacts (2.1.5):
8080
- RNPermissions
81-
- Permission-FaceID (2.1.4):
81+
- Permission-FaceID (2.1.5):
8282
- RNPermissions
83-
- Permission-LocationAlways (2.1.4):
83+
- Permission-LocationAlways (2.1.5):
8484
- RNPermissions
85-
- Permission-LocationWhenInUse (2.1.4):
85+
- Permission-LocationWhenInUse (2.1.5):
8686
- RNPermissions
87-
- Permission-MediaLibrary (2.1.4):
87+
- Permission-MediaLibrary (2.1.5):
8888
- RNPermissions
89-
- Permission-Microphone (2.1.4):
89+
- Permission-Microphone (2.1.5):
9090
- RNPermissions
91-
- Permission-Motion (2.1.4):
91+
- Permission-Motion (2.1.5):
9292
- RNPermissions
93-
- Permission-Notifications (2.1.4):
93+
- Permission-Notifications (2.1.5):
9494
- RNPermissions
95-
- Permission-PhotoLibrary (2.1.4):
95+
- Permission-PhotoLibrary (2.1.5):
9696
- RNPermissions
97-
- Permission-Reminders (2.1.4):
97+
- Permission-Reminders (2.1.5):
9898
- RNPermissions
99-
- Permission-SpeechRecognition (2.1.4):
99+
- Permission-SpeechRecognition (2.1.5):
100100
- RNPermissions
101-
- Permission-StoreKit (2.1.4):
101+
- Permission-StoreKit (2.1.5):
102102
- RNPermissions
103103
- RCTRequired (0.62.2)
104104
- RCTTypeSafety (0.62.2):
@@ -322,7 +322,7 @@ PODS:
322322
- React-cxxreact (= 0.62.2)
323323
- React-jsi (= 0.62.2)
324324
- ReactCommon/callinvoker (= 0.62.2)
325-
- RNPermissions (2.1.4):
325+
- RNPermissions (2.1.5):
326326
- React
327327
- RNVectorIcons (6.6.0):
328328
- React
@@ -514,21 +514,21 @@ SPEC CHECKSUMS:
514514
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
515515
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
516516
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
517-
Permission-BluetoothPeripheral: 2c8ce842373ae7162e41428d66831247fdd660c5
518-
Permission-Calendars: a451703f55ae46a53be140407b8ae18dcfaf89da
519-
Permission-Camera: 402f1ac15b962448d75e8cf2039d235e7bc09a85
520-
Permission-Contacts: 546030b78788365b36c202b7ac5a8205f8c7efba
521-
Permission-FaceID: 08f06f502c95dbd7d35033e65c7ebe23d4189f67
522-
Permission-LocationAlways: 48085521ad224052f5b25c3fdc6d0e996d162428
523-
Permission-LocationWhenInUse: 7449010ca36a26dbe6b10e69e9d6ebcab0222c42
524-
Permission-MediaLibrary: 04ebc411e788b3ff11c74c30128ecf6507cdc9ce
525-
Permission-Microphone: 84332821b494a0864867ae41c0b29f28002db47b
526-
Permission-Motion: f1d0e65296b9a741ac3493a86c2330b8c06b04b4
527-
Permission-Notifications: d437cafc026900006d35981d35a2d694f883f44e
528-
Permission-PhotoLibrary: d98d4dcf5da6bb811fac27abdd441e6a2facc53c
529-
Permission-Reminders: bf9a50c0bacbff547eaebc9f2af6b7648b9854d9
530-
Permission-SpeechRecognition: f72edf19023885941b0c37762d2d1563ffb37237
531-
Permission-StoreKit: 0e6437409b465302ad5c1f30b80c21776b7f9530
517+
Permission-BluetoothPeripheral: 4663a8373072abfe3099c44cb06bf10b0c16c110
518+
Permission-Calendars: dc345e3388149514603309c621151ff3cfd5816a
519+
Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b
520+
Permission-Contacts: edde2d433382b3118f0d4c9ebc7708d5d87c4f17
521+
Permission-FaceID: fbdeb41087f35887f0cade55396007fadee3a234
522+
Permission-LocationAlways: 155e6251b757b380f6354737cae8e8d59c472495
523+
Permission-LocationWhenInUse: 3624cf08c12c6019926aba3054efee7f4f8ee91e
524+
Permission-MediaLibrary: dd1c48888cd95961fbfebdaebf8d4127c6e92e7d
525+
Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c
526+
Permission-Motion: 099bc32191080089d1cb839cbae96d621a589c8f
527+
Permission-Notifications: 231d0e1db2300b686548587d384ba414e6a93332
528+
Permission-PhotoLibrary: 4d2eff62c8f4b8a27bcf045c0e36f5047efbbf20
529+
Permission-Reminders: 330cfafecc259594cfd7845a035580b623f771ae
530+
Permission-SpeechRecognition: 069447d0304a16237a43e9221052da7581d7f48c
531+
Permission-StoreKit: 27c9c90c94ecdc144551623a3fc14ac7488f3000
532532
RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035
533533
RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce
534534
React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3
@@ -548,7 +548,7 @@ SPEC CHECKSUMS:
548548
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
549549
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
550550
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
551-
RNPermissions: 3635b407c15f2fe591bd2101c8f20aa0912caba8
551+
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
552552
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
553553
Yoga: 3ebccbdd559724312790e7742142d062476b698e
554554
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

example/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3505,7 +3505,7 @@ [email protected]:
35053505
react-native-safe-area-view "^0.14.6"
35063506

35073507
react-native-permissions@../:
3508-
version "2.1.4"
3508+
version "2.1.5"
35093509

35103510
react-native-safe-area-view@^0.14.6:
35113511
version "0.14.9"

ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@interface RNPermissionHandlerBluetoothPeripheral() <CBPeripheralManagerDelegate>
66

7-
@property (nonatomic, strong) CBPeripheralManager* peripheralManager;
7+
@property (nonatomic, strong) CBPeripheralManager* manager;
88
@property (nonatomic, strong) void (^resolve)(RNPermissionStatus status);
99
@property (nonatomic, strong) void (^reject)(NSError *error);
1010

@@ -63,17 +63,13 @@ - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
6363
_resolve = resolve;
6464
_reject = reject;
6565

66-
_peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil options:@{
66+
_manager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil options:@{
6767
CBPeripheralManagerOptionShowPowerAlertKey: @false,
6868
}];
69-
70-
[_peripheralManager startAdvertising:@{}];
7169
#endif
7270
}
7371

7472
- (void)peripheralManagerDidUpdateState:(nonnull CBPeripheralManager *)peripheral {
75-
[_peripheralManager stopAdvertising];
76-
7773
switch (peripheral.state) {
7874
case CBManagerStatePoweredOff:
7975
case CBManagerStateResetting:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-permissions",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"license": "MIT",
55
"description": "An unified permissions API for React Native on iOS and Android",
66
"author": "Mathieu Acthernoene <[email protected]>",

0 commit comments

Comments
 (0)