Skip to content

Commit 011f4d6

Browse files
committed
Merge pull request #306 from philippec/master
Fix for iOS 6 compatibility
2 parents 0c768e4 + 39f1a96 commit 011f4d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Analytics/Helpers/SEGBluetooth.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ - (id)init {
2828

2929
_queue = dispatch_queue_create("io.segment.bluetooth.queue", NULL);
3030

31-
if (&CBCentralManagerOptionShowPowerAlertKey != NO) {
31+
// Reading the address inline fails on iOS 6, must use a temporary
32+
// variable to compare.
33+
NSInteger addr = &CBCentralManagerOptionShowPowerAlertKey;
34+
if (addr != 0) {
3235
_manager = [[centralManager alloc] initWithDelegate:self queue:_queue options:@{ CBCentralManagerOptionShowPowerAlertKey: @NO }];
3336
} else {
3437
_manager = [[centralManager alloc] initWithDelegate:self queue:_queue];

0 commit comments

Comments
 (0)