I have an app which is like Home Automation but in iOS 14.5 and above but it doesn't support for multicast networking.

I have implemented for multicast networking in my app as per document I found on https://developer.apple.com/forums/thread/663271 and also I did this steps as mentioned in https://developer.apple.com/news/?id=0oi77447 as well . Although I got error again and again which is "No route to host".

I use local udp socket and I used cocoapods library “ pod 'CocoaAsyncSocket', '~> 7.6.5'”. but although I used to get this error “Invalid argument”.

Here I add Multicast Networking which is approved by apple. And also I have explicit App ID of my automation app.

Then I also edited in both certificates developer and distribution then I do save and added in my Xcode project.

Then I added in in my entitlements which is com.apple.developer.networking.multicast entry with a Boolean value of true.

I have also run this command line tool and I got this result. Then I run the project in iOS 14.5 – iPhone 8 Plus.

But although I got this error.

Regards, Narendra Sorathiya

Hello Narendra,

There are a few things I see here.

  1. You are using a broadcast address for the NWMulticastGroup API. Try using the commented out address you have there for 224.0.0.251 over port 8081 for Multicast. If you need to support Broadcast instead of Multicast then you do not want NWMulticastGroup, and you should take a look at one of two things; first, using sockets for Broadcast traffic if you need to send and receive multiple broadcast messages on the network. For iOS 14 this is your most reliable option. Next, if you just need to send and receive the first broadcast message only you can use NWConnection for this. Note that NWConnection will only take the first read on a broadcast message.

  2. If you really meant to use Multicast here then you will need to change your code for GCDAsyncUdpSocket. I do not claim to be an expert on this API but it does look like you intended to work with Broadcast traffic here, so Multicast will not work. Also, you are not using the same port between the two.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
I have an app which is like Home Automation but in iOS 14.5 and above but it doesn't support for multicast networking.
 
 
Q