Skip to content

Commit

Permalink
Merge pull request jbeuckm#1 from webdents/master
Browse files Browse the repository at this point in the history
Updated stopAdvertisingBeacon method to handle crash when calling it whe...
  • Loading branch information
jbeuckm committed Nov 17, 2013
2 parents 696ae46 + 9c4233a commit 46c633a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Classes/OrgBeuckmanTibeaconsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,17 @@ - (void)startAdvertisingBeacon:(id)args

- (void)stopAdvertisingBeacon:(id)args
{
[self.peripheralManager stopAdvertising];

NSLog(@"[INFO] Turned off advertising.");
if (self.peripheralManager) {

if (self.peripheralManager.state == CBPeripheralManagerStatePoweredOn){

[self.peripheralManager stopAdvertising];
NSLog(@"[INFO] Turned off advertising.");
}else{
NSLog(@"[INFO] peripheral manager state was off, no need to turn advertsing off");
}
}
}

#pragma mark - Beacon advertising delegate methods
Expand Down

0 comments on commit 46c633a

Please sign in to comment.