Skip to content
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

Devices search failed on iOS 14 and deployment target iOS 12 or newer #62

Open
petrutms opened this issue Dec 18, 2020 · 10 comments
Open

Comments

@petrutms
Copy link

If I set deployment target to iOS 12, app will fail to discover devices. This happens in the sample app also.
I couldn't find a fix yet.
Any help will be appreciated.

@squarefrog
Copy link
Member

I’ve run into this too when I bumped.

What happens is the first message you send after connecting the multicast group always returns a “no route to host” error.

If you build with Xcode 11, there’s no problem. If you build with Xcode 12, with a minimum deployment target of iOS 11, there’s no error. So there’s only an error when building with Xcode 12, targeting iOS 12 and above, and only on iOS 14 devices.

I pushed some code to the develop branch, that’s worth a look at. I’m not convinced it solves the issue, but you’re welcome to try!

@petrutms
Copy link
Author

petrutms commented Dec 18, 2020

I can only target iOS 12 or better, due to app features. The example app now detects almost all devices, except webos LG. The services for LG sometimes appear much later, maybe after 10-20 seconds, but many times LG is not detected at all, unless I turn off then on the TV.

This error always in console: Could not start browsing for services: Error Domain=NSPOSIXErrorDomain Code=65 "No route to host" UserInfo={NSLocalizedDescription=No route to host, NSLocalizedFailureReason=Error in send() function.}

Thanks. Let me know how I can help to fix this issue!
P.S. do you think the new multicast entitlement on iOS 14 is need for this to work?

@squarefrog
Copy link
Member

That indicates the search isn’t getting sent, and the LG device is merely announcing its presence.

There are others having this issue: https://developer.apple.com/forums/thread/661606?login=true&page=1#650998022

I had hoped iOS 14.3 would fix it but I haven’t tested it under that yet.

Digging into the CocoaAsyncSocket dependency, it seems they are destroying the socket when that error is returned, whereas we need to keep it open and just ignore the first faulty error. I haven’t found a solution yet, but that’s where I’d direct you if you’re under time constraints.

@petrutms
Copy link
Author

I am testing on iOS 14.3, no change there unfortunately... Thanks for the help, will keep looking

@petrutms
Copy link
Author

Tested one of my older projects that use connect sdk, the discovery issue isn't there in the same build conditions. So something broken in CocoaAsync maybe... For the moment I asked apple for multicast entitlement...

@squarefrog
Copy link
Member

Have you tried building from Xcode 11?

@petrutms
Copy link
Author

petrutms commented Dec 19, 2020

I just did. There is the same issue with LG, not detected or detected very slowly. Other brands work fine.
Also multicast doesn't help.

edit: it happens only on iOS 14

@squarefrog
Copy link
Member

Did you get your multicast entitlement approved by Apple, and did it solve your issue?

@petrutms
Copy link
Author

petrutms commented Jan 26, 2021 via email

@squarefrog
Copy link
Member

OK thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants