name
The full name of the service, as sent over the air.
Declaration
let name: StringDiscussion
To avoid conflicts with other apps and devices that may prevent your app from using the service, register your service with a unique name in the IANA Service Name Registry.
For the service name to be valid, follow the rules located in RFC 6763 and RFC 6335.
The RFC rules require that the service string have a unique name that conforms to the following rules:
Only use characters such as
a-z,A-Z,0 - 9, and hyphen (-).Use at least one letter
a-z,A-Z.Don’t start or end with a hyphen (
-).Don’t exceed 15 characters.
The full service name string then:
Prepends an underscore (
_) to the name componentAdds a dot (
.) separatorAppends a protocol suffix of
_tcpor_udp
The table below shows some examples:
Examples:
Name Component | Protocol Component | Full Service Name string |
|---|---|---|
|
|
|
|
|
|
The name in the Info.plist must be this full service name, exactly as it is sent over-the-air. Invalid service names in the Info.plist will cause the app to crash.