title: Waking iOS app from Bluetooth event
body: <p>Our app currently uses CoreBluetooth to communicate with a smart watch. The issue is that if the app is (assumed) jetsammed <em>(maybe after being backgrounded overnight)</em>, the only bluetooth event that seems to wake the app and initiate reconnections is powering off / powering on Bluetooth from iOS.</p>
  
  <p>I do implement the following methods to ensure that reconnections happen, and that connections happen when the app retrieves connected peripherals <em>(code has been stripped down to essential)</em>:</p>
  
  <pre><code>NSArray * connectedPeripherals = [_centralManager retrieveConnectedPeripheralsWithServices:@[kMyServiceUUID]];
  for ( CBPeripheral * peripheral in connectedPeripherals )
  {
      if ( peripheral.state == CBPeripheralStateConnected )
          continue;
      else
          [_centralManager connectPeripheral:peripheral options:@{CBConnectPeripheralOptionNotifyOnDisconnectionKey:[NSNumber numberWithBool:TRUE]}];
  }
  
  - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error {
      [_centralManager connectPeripheral:peripheral options:@{CBConnectPeripheralOptionNotifyOnDisconnectionKey:[NSNumber numberWithBool:TRUE]}];
  }
  </code></pre>
  
  <p>How can I ensure that my app is able to reconnect to watches if it has been in the background, say over night?</p>
  
  <p>Along the same lines, how can I ensure that the app wakes up or is able to receive data from the watch if the app has in fact been jetsammed?</p>