udark / underdark-cocoa

Bluetooth peer-to-peer mesh networking for iOS
http://underdark.io
Other
123 stars 24 forks source link

Bluetooth connection not working in iOS11 #10

Open arpanCode opened 7 years ago

arpanCode commented 7 years ago

Hey Virl, Hope you are doing good. Just want to let you know Bluetooth connection not working anymore after updating iOS version to 11. Devices are not able to connect when transmission enables via bluetooth only. Do you have any idea or planning to update with iOS 11 compatibility ? Thanks

virl commented 7 years ago

@arpanCode Greetings. It's an iOS 11 bug: iOS 11 broke peer-to-peer Bluetooth for all other apps, not just my library (for example, see https://github.com/robbiehanson/CocoaAsyncSocket/issues/571).

I filed bug report with Apple (rdar://34615975) and they started investigating the issue. Considering that this is completely legal/official Bluetooth API that has not been deprecated and is widely used, I hope that it will be fixed in one of the next minor iOS updates.

Stefan3533 commented 7 years ago

Hi awesome library thanks for making it open source. Any news from Apple yet I highly doubt they will take any action soon though :(

virl commented 7 years ago

@Darth-Vladimir Currently no any other news, but considering how buggy iOS 11 release was, I think it is just one of many bugs that will be fixed.

In iOS 11, even calculator doesn't work: try typing 3+2+1 quickly in it.

Stefan3533 commented 7 years ago

I am never feeling bad as a developer in my life again

Stefan3533 commented 7 years ago

@virl I updated to iOS 11.1 beta 5 and still not working pretty sure BLE is still not working as I can not pair with another iOS 11.1 device as well just using the OS. Just an FYI

virl commented 7 years ago

@Darth-Vladimir Thanks for testing. By "BLE" you mean my library, or iOSCoreBluetooth SDK?

Also if you want to potentially speed up process of Apple fixing this bug, I think you can submit your own bug report to them and link to my bug report (rdar://34615975).

virl commented 7 years ago

Update notes of recently released macOS 10.13.1 contain following: "Fixes a bug where Bluetooth may be unavailable during Apple Pay transactions".

My assumption is that iOS 11 Bluetooth problems have similar cause in Apple refactoring networking code for P2P Apple Pay support. Hopeful news is that in case of macOS such Bluetooth-related bugs are getting addressed.

Stefan3533 commented 7 years ago

@virl I just read this forum article [https://forums.developer.apple.com/message/273031#273031] which shows peer to peer bluetooth was removed from ios 11 but the work around is to use DNS-SD API. I have never used this before also not sure what your library depends on? Does it use NSNetService and low-level DNS bonjour?

virl commented 7 years ago

Thanks for the link. I reposted it to Apple's bug tracker. My library currently depends on NSNetService.

I will write here after I create workaround using DNS-SD.

ggschelling commented 6 years ago

@virl Any news on this issue? Thx!

virl commented 6 years ago

@ggschelling Hello. Currently no, it seems it will require library rewrite for DNS-SD.

dado3212 commented 6 years ago

Is there any ETA on this being addressed/is there anything that users can do to help? This has severely impacted the reliability and ease of use of the library, and would love to have a rough idea of when it's planning on being updated.

virl commented 6 years ago

Currently no ETA, but I will post here any plans or progress when I have one.

Sorry for inconvenience. This issue is due to broken standard&legal functionality of system iOS API, so for me to develop workaround (that requires major rewrite) is basically investment in something that may be fixed by Apple anyway in nearby months.

That’s why I’m postponing work on it to the some later major library release.

lizethkemny commented 6 years ago

If you have Bluetooth problems after update to latest iOS 11 in your iPhone this article will provide full solutions to fix your Bluetooth issues on iOS 11: https://www.howtoisolve.com/ios-11-bluetooth-not-working/

EskelCz commented 6 years ago

So, was this fixed in iOS 12?

virl commented 6 years ago

@EskelCz Yes, I’ve fixed iOS 12 Bluetooth connectivity in beta version of the library. I’m planning to release it as public beta (along with connectivity testing app) this week.

EskelCz commented 6 years ago

Awesome, I’ll test it out. Thanks :)

EskelCz commented 6 years ago

@virl Also, will it work in the background? I’ve read that apple is using some proprietary protocol for background advertising and it seems to have been reverse engineered. https://crownstone.rocks/2018/06/27/ios-advertisements-in-the-background

(I’m building a game that needs to be able to find player phones nearby, even in background and notify them of each other.)

virl commented 6 years ago

@EskelCz As far as I understand currently, iPhone-to-iPhone discovery & connect via Bluetooth will work as long as at least one of the devices have app on the screen (other device can have app in background). It is limitation of iOS.

Potentially you can request full-fledged Bluetooth background mode via iOS app entitlement, but I haven't researched it in detail yet.

virl commented 6 years ago

@EskelCz Public beta takes more time that I anticipated, so most probably I will publish it at the end of this week.

EskelCz commented 6 years ago

@virl ok, thanks for the info, looking forward to it.

I've read that the app entitlement gives you the background connectivity only between iOS devices, because it uses a proprietary protocol in an 'overflow' area, hence the article I linked where they reverse engineered it.

I really need to somehow accomplish reliable background discoverability between both platforms, so I'm thinking about licensing the hack from Crownstone. Then I'm gonna have to figure out how to incorporate it into underdark (or bridgefy).

EskelCz commented 6 years ago

@virl Any news? :)

poojaagarwal1331 commented 4 years ago

@virl Any news on the update?

poojaagarwal1331 commented 4 years ago

@EskelCz I too want to implement the same without using Bridgefy, let me know the work around. Thanks in advance.

azizimusa commented 4 years ago

does anyone succeed connecting via bluetooth iphone + android?