I'm using NWConnection to send my discoveryTokens. When an outgoing connection is found, I have the following code:
Why is it that the discoveryToken sometimes returns nil? Is there a remedy for this?
This has happened on multiple occasions and because of this nothing is sent. There doesn't seem to be a workaround nor any documentation on why this occurs
Code Block let session = NISession() guard let token = session.discoveryToken else { print("discoveryToken is nil") return } guard let data = try? NSKeyedArchiver.archivedData(withRootObject: token, requiringSecureCoding: true) else { return } // send data ...
Why is it that the discoveryToken sometimes returns nil? Is there a remedy for this?
This has happened on multiple occasions and because of this nothing is sent. There doesn't seem to be a workaround nor any documentation on why this occurs