Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136692

BLE devices can't be discovered after initial connection on iOS 18+

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • 4fc42facc (dev), 7d53044f1 (6.10), eb2a7efef (6.9), 5478c232a (tqtc/lts-6.8), 0bd4adb9d (tqtc/lts-6.5)
    • Foundation Sprint 130, Foundation Sprint 131
    • iOS/tvOS/watchOS

    Description

      On iPhones, with iOS 18+, an already (with the phone) connected BLE device will not be discovered/availiable while rescanning. That makes BLE devices inaccessible to Qts BLE support after the first connection of the respecive device.

      Steps to reproduce:

      1. clone https://doc.qt.io/qt-6/qtbluetooth-lowenergyscanner-example.html
      2. Scan for a device and connect to the device on an iOS 18 iPhone
      3. Close the app and make sure you see the BLE connection at Settings->Bluetooth
      4. Restart the app and scan again -> You will not find the BLE device anymore
        (If you see the attached video, you can see I'm connecting to the EON Core (scuba diving computer), after the initial connection, the device can't be found anymore)

      The same issue can be also experienced with the app subsurface: https://github.com/subsurface/subsurface

      I think this is the API change causing the issue:
      Before iOS 18, CoreBluetooth’s methods for scanning and retrieving connected peripherals could be called without explicitly supplying service filters (you could pass an empty array or nil and still get results). In iOS 18, Apple tightened these APIs so that both https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/retrieveconnectedperipherals(withservices:)

      https://developer.apple.com/forums/thread/760309

      The same issue I was able to experience with Flutter and flutter_blue_plus, which is resolving the issue at version 1.33
      https://github.com/chipweinberger/flutter_blue_plus/blob/master/packages/flutter_blue_plus/CHANGELOG.md
      [BREAKING CHANGE] iOS 18 compatibility: systemDevices now requires UUID argument
       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-136692
          # Subject Branch Project Status CR V

          Activity

            People

              vuokko Juha Vuolle
              bmahr80 Ben Mahr
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes