2 Replies
      Latest reply on Dec 26, 2019 11:45 PM by ZhangYJ
      rschulte Level 1 Level 1 (0 points)

        Hi there,


        i'm currently working on an iOS app that uses a combination of CoreBluetooth and CoreLocation to interact with BLE devices from the background. We want our app to wake up, after one of our beacons is detected. After that we need to start a BLE scan to receive additional informations about the device from their scan response and notifing the user about the device via a user notification.


        Currently, the app always wakes up when entering our beacon region. In the console app of the connected Mac, we can see that the bluetooth scan is triggered again. But the didDiscoverPeripheral callback will never be called. We registered the `bluetooth-central` role in our `info.plist` and also specify a concrete service UUID to scan for, but still there's no response when the app is restarted. We also created a serial background queue for our CBCentralManager and registered a restore identifier.


        Everything works fine when the app runs in foreground or is send to background. But after the application is killed via the task manager (double tap on home button and swipe up) the bluetooth scan cannot be started again.


        This is our current test scenario:


        1. Launch App via XCode
        2. Kill app via task manager (double tap on home button and swipe up)
        3. Enable iBeacon device
        4. App receives enter region event and wakes up
        5. App starts bluetooth scan with concrete service UUID and without duplicates
        6. `centralManager(_ :, didDiscover:, advertisementData: , rssi:)` is never called


        Is there something we are missing?