Ellen Spertus
10/02/2019, 6:18 PMclass NearbyConnection{
var connectionsClient: ConnectionsClient = Nearby.getConnectionsClient(context)
public sealed class ConnectionState(val name: String) {
inner class Authenticating: ConnectionState("authenticating") {
fun accept() {
connectionsClient.acceptConnection(neighborId, payloadCallback)
updateState(ConnectionState.Connecting(neighborId, neighborName))
}
}
I am getting the error “unresolved reference connectionsClient” within the function.karelpeeters
10/02/2019, 6:19 PMEllen Spertus
10/02/2019, 6:20 PMModifier 'inner' is incompatible with 'sealed'
.karelpeeters
10/02/2019, 6:21 PMEllen Spertus
10/02/2019, 6:22 PMAuthenticating
state.)Ellen Spertus
10/02/2019, 6:23 PMkarelpeeters
10/02/2019, 6:24 PMKirill Zhukov
10/02/2019, 6:35 PMConnectionsClient
instance through API (accept
function in your case) instead of relying on inner stateEllen Spertus
10/02/2019, 6:38 PMConnectionState
gets passed to a client who should not need to know about the ConnectionsClient
.