---
title: "init(_:)"
framework: wifiaware
role: symbol
role_heading: Initializer
path: "wifiaware/washaredsecret/protocolname/init(_:)-648hd"
---

# init(_:)

Creates a custom protocol with the provided unique string.

## Declaration

```swift
init?(_ data: Data)
```

## Parameters

- `data`: The data to use as the underlying protocol name, which must be greater than or equal to 3 bytes.

## Return Value

Return Value A new WASharedSecret.ProtocolName, or nil if the provided data was too short.

## Discussion

Discussion Custom protocols need to specify data that identifies the protocol that will use the shared secret. Set the same value on the local and remote devices in order to generate the same shared secret.
