acceptConnection method
Future<bool>
acceptConnection(
- String endpointId, {
- required OnPayloadReceived onPayLoadRecieved,
- OnPayloadTransferUpdate? onPayloadTransferUpdate,
Needs be called by both discoverer and advertiser to connect
Call this in OnConnectionInitiated to accept an incoming connection
OnConnectionResult is called on both only if both of them accept the connection
Implementation
Future<bool> acceptConnection(
String endpointId, {
required OnPayloadReceived onPayLoadRecieved,
OnPayloadTransferUpdate? onPayloadTransferUpdate,
}) async {
_onPayloadReceived = onPayLoadRecieved;
_onPayloadTransferUpdate = onPayloadTransferUpdate;
return await _channel.invokeMethod(
'acceptConnection',
<String, dynamic>{
'endpointId': endpointId,
},
) ??
false;
}