Re: How do I find the device's Bonjour hostname?
Re: How do I find the device's Bonjour hostname?
- Subject: Re: How do I find the device's Bonjour hostname?
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 20 Dec 2016 21:39:55 +0000
On 20 Dec 2016, at 18:51, Jens Alfke <email@hidden> wrote:
> It looks as though this just returns the first component of the name, which needs to have “.local” appended; is this correct?
Yes.
> But I also need this to work on iOS, and that function’s not available there.
On iOS I would register a service in `local.` and resolve that.
IMPORTANT: You’re looking for NSNetService’s `hostName` property; the `name` property gives you the computer name (equivalent to `SCDynamicStoreCopyComputerName`).
Please do file a bug against iOS for not having a better way to get this. It seems like it would be a good fit for NSProcessInfo, which already has a `hostName` property that returns the `gethostname` value (and also supports KVO for various other properties like this).
<https://developer.apple.com/bug-reporting/>
Please post the bug number so that I can associate it with this incident.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden