title: IOS app does not receive fire event from bluetooth device after connecting with it
body: <p>I have a bluetooth device. When i fired device, IOS app receive fire event from it in <code>func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber)</code> method in <code>advertisementData["kCBAdvDataLocalName"]</code> But when i connect BLE bluetooth device with my app through <strong>centralManager.connect(heartRatePeripheral)</strong> method it did not receive fire event in any of the <strong>CBPeripheralDelegate</strong> methods. Please help me how to get event after connecting BLE device with IOS app. Below is my full code. </p>
  
  <pre><code>import UIKit
  import CoreBluetooth
  
  let heartRateServiceCBUUID = CBUUID(string: "FFC2")
  
  class HRMViewController: UIViewController {
  
     @IBOutlet weak var heartRateLabel: UILabel!
     @IBOutlet weak var bodySensorLocationLabel: UILabel!
  
     var centralManager: CBCentralManager!
     var heartRatePeripheral: CBPeripheral!
  
     override func viewDidLoad() {
        super.viewDidLoad()
  
        centralManager = CBCentralManager(delegate: self, queue: nil)
        heartRateLabel.font = UIFont.monospacedDigitSystemFont(ofSize: 
        heartRateLabel.font!.pointSize, weight: .regular)
     }
  
     func onHeartRateReceived(_ heartRate: Int) {
         heartRateLabel.text = String(heartRate)
         print("BPM: \(heartRate)")
     }
  }
  
  extension HRMViewController: CBCentralManagerDelegate {
     func centralManagerDidUpdateState(_ central: CBCentralManager) {
     }
  
     func centralManager(_ central: CBCentralManager, didDiscover  
     peripheral: CBPeripheral, advertisementData: [String : Any], rssi 
     RSSI: NSNumber) {
         if advertisementData["kCBAdvDataLocalName"] as? String == 
             "SPS026A" {
             print(advertisementData["kCBAdvDataLocalName"])
             let data = 
              advertisementData[CBAdvertisementDataManufacturerDataKey]
              print("data ==\(data)")
              heartRatePeripheral = peripheral
              centralManager.connect(heartRatePeripheral)
          }
     }
  
     func centralManager(_ central: CBCentralManager, didConnect 
     peripheral: CBPeripheral) {
          print("Connected!")
          heartRatePeripheral.discoverServices([])
          heartRatePeripheral.delegate = self
      }
  }
  
  extension HRMViewController: CBPeripheralDelegate {
      func peripheral(_ peripheral: CBPeripheral, didDiscoverServices 
      error: Error?) {
           guard let services = peripheral.services else { return }
           for service in services {
               print(service)
               peripheral.discoverCharacteristics(nil, for: service)
           }
       }
  
       func peripheralDidUpdateName(_ peripheral: CBPeripheral) {
  
       }
  
       func peripheral(_ peripheral: CBPeripheral, 
       didDiscoverCharacteristicsFor service: CBService, error: Error?) 
       {
            guard let characteristics = service.characteristics else { 
            return }
            for characteristic in characteristics {
                 if characteristic.properties.contains(.read) {
                      print("\(service): service : \ . 
                      (characteristic.uuid): properties contains .read")
                      peripheral.readValue(for: characteristic)
                  }
                 if characteristic.properties.contains(.notify) {
                       print("\(service): service : \ 
                       (characteristic.uuid): properties contains 
                       .notify")
                        peripheral.setNotifyValue(true, for: 
                        characteristic)
                  }
              }
         }
  
         func peripheral(_ peripheral: CBPeripheral, didOpen channel: 
         CBL2CAPChannel?, error: Error?) {
  
         }
  
         func peripheralIsReady(toSendWriteWithoutResponse peripheral: 
         CBPeripheral) {
  
         }
  
         func peripheral(_ peripheral: CBPeripheral, 
         didUpdateNotificationStateFor characteristic: CBCharacteristic, 
         error: Error?) {
               print("Unhandled Characteristic UUID: \(characteristic)")
         }
  
         func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor 
         characteristic: CBCharacteristic, error: Error?) {
               print("Unhandled Characteristic UUID: \(characteristic)")
         }
     }
  </code></pre>