title: How to scan only for beacons with CoreBluetooth
body: <p>I used this function for scanning BLE around me, but I receive too much signals. I'd like to work with signals only from beacons.</p>
  
  <pre><code>func centralManagerDidUpdateState(_ central: CBCentralManager) {
      centralManager.scanForPeripherals(withServices: nil, options: [CBCentralManagerScanOptionAllowDuplicatesKey : NSNumber(value: true)])
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wi30f.jpg" rel="nofollow noreferrer">I had used LightBlue</a> and found out that my beacon has 5 services: 180A, FFA0, FFB0, FFF0 and 180F. </p>
  
  <p>Then I tried this code, but no peripherals found with this service.</p>
  
  <pre><code>let serviceUUIDs = [CBUUID(string: "FFA0")]
  
  func centralManagerDidUpdateState(_ central: CBCentralManager) {
      centralManager.scanForPeripherals(withServices: serviceUUIDs, options: [CBCentralManagerScanOptionAllowDuplicatesKey : NSNumber(value: true)])
  }
  </code></pre>
  
  <p>And didDiscover method never called</p>
  
  <pre><code>func centralManager(_ central: CBCentralManager,
                      didDiscover peripheral: CBPeripheral,
                      advertisementData: [String : Any],
                      rssi: NSNumber)
  {
      if peripheral.name == "MY_BEACON_NAME" {
          print("peripheral: \(peripheral)")
          print("rssi = \(rssi)")
      }
  }
  </code></pre>
  
  <p>What I'm doing wrong?</p>
  
  <p>P. S. I can't use CoreLocation for this project, only CoreBluetooth. </p>