-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin doesn't work in iOS 18 #711
Comments
Hi @gassssty Did this app work with previous versions of iOS? I have found that iOS tends to be more timing sensitive than Android. Given this is timing out in the service discovery phase, I wonder if perhaps the device you're connecting to is taking too long to finish discovery. Do you have any control over the peripheral itself? Do you know anything about it's connection interval, connection latency etc? |
Hi! No, it doesn't work on an older version, specifically 17.4. Actually on Android it always works on the first try and there's nothing wrong with the code, at least from what it seems. Do you have any control over the peripheral itself? About the peripheral information, here you have:
And we don't have more information in the app nrf Connect. FYI: in Android is never connecting as OS level and with iOS always, with different iOS versions. Thanks!! |
Interesting. That advertising interval is very slow. Do you have any details about the connection interval or latency? (I believe nrf Connect on Android can show this information too). How many services/characteristics are exposed via this peripheral? |
Well, there isn't more information than this. And we have 22 characteristics. |
22 characteristics is quite a lot! Can you try adding a very long timeout to your
With nrf Connect, it's a little bit tricky, but if you swipe to the right on the bottom left of the connected screen... you'll see this console slide out with some additional debug info: |
This is strange. On Android, that discovery is taking only about 500ms... I wonder why it's taking so much longer on iOS. I can't answer for sure what the upper limit is. I've definitely used things with several services and 5-8 characteristics per service. Never 22 on a single service... but you're saying that this isn't working with 2 on iOS? There are some subtle differences between iOS and Android's connection paths that I've occasionally hit where a peripheral connects on Android (usually) and not iOS. I can't really guess the cause in your case though. Do you get any debug logs from the PC side of the connection, to spot any differences? |
Yes, we tried with 120000 ms in the timeout option and it did not success... but we are going to try to reduce this 22 characteristics to 2 or something like that. Exactly, is not working in 2 differente iOS devices, with different versions. In theory in Android Studio it shows the same logs as the XCode does. The strange 'thing' is that in iOS is connecting always as SO and never in Android. |
Hi guys,
I'm trying to add this plugin for use on iOS phones but I'm not having any success in implementing it. However, for Android phones, it works perfectly.
Actually, the code is the same for both platforms. Let me explain a little bit what's happening with images and functions in code:
And then, we have some logs that we saw in the Xcode App:
⚡️ To Native -> BluetoothLe removeListener 51121821
⚡️ To Native -> BluetoothLe addListener 51121822
⚡️ To Native -> BluetoothLe connect 51121823
⚡️ BluetoothLe - Connecting to peripheral <CBPeripheral: 0x3018109c0, identifier = 338676A7-6DF4-02F6-210B-A84762F07FA6, name = pickio-004-005, mtu = 517, state = connected>
⚡️ [error] - ERROR {"errorMessage":"Connection timeout"}
⚡️ BluetoothLe - Connected to device <CBPeripheral: 0x3018109c0, identifier = 338676A7-6DF4-02F6-210B-A84762F07FA6, name = pickio-004-005, mtu = 517, state = connected>
⚡️ BluetoothLe - Resolve connect|338676A7-6DF4-02F6-210B-A84762F07FA6 Successfully connected.
⚡️ BluetoothLe - Connected to peripheral. Waiting for service discovery.
⚡️ BluetoothLe - Reject connect Connection timeout
ERROR MESSAGE: {"message":"Connection timeout","errorMessage":"Connection timeout"}
⚡️ [error] - {"message":"Connection timeout","errorMessage":"Connection timeout"}
iOS Version: 18.1
Angular: 18.0.0
Ionic: 8.0.0
Capacitor Community BLE: 6.0.0
Thank you very much, guys!! :D
The text was updated successfully, but these errors were encountered: