Closed Maximvdw closed 11 months ago
EDIT: After reading up on it, there does not seem to be a valid reason to 'scan' for an empty list, as this would not start a scan
Where did you read this? In my tests, whether services is nil
or an empty array doesn't matter and I obtain the same scan results.
It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.
Have a great day! Capacitor Community Bot 💙
iOS supports the scanning of BLE devices without specifying a service list. This requires the service list to be
nil
: https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1518986-scanforperipherals#discussionHowever, on this line: https://github.com/capacitor-community/bluetooth-le/blob/main/ios/Plugin/Plugin.swift#L509 an empty array is used when no services are provided in the call, preventing any possibility to get nil.
Since an empty array would not do anything, I propose to return nil in the aforementioned getServiceUUIDs method. ~If developers still want the scanning of an empty array for some reason, they can just pass it along.~
EDIT: After reading up on it, there does not seem to be a valid reason to 'scan' for an empty list, as this would not start a scan