• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I find the device's Bonjour hostname?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How do I find the device's Bonjour hostname? (From: Jens Alfke <email@hidden>)
 >Re: How do I find the device's Bonjour hostname? (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: How do I find the device's Bonjour hostname? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: How do I find the device's Bonjour hostname?
  • Previous by thread: Re: How do I find the device's Bonjour hostname?
  • Next by thread: Re: How do I find the device's Bonjour hostname?
  • Index(es):
    • Date
    • Thread