Table of Contents

Enum NearbyEndReason

Namespace
Plugin.Maui.NearbyConnectivity
Assembly
Plugin.Maui.NearbyConnectivity.dll

Specifies why a device left the device set, why a handshake ended, or why an established connection ended. Carried by Reason.

public enum NearbyEndReason

Fields

AppSuspended = 9

The operating system suspended the application, so the session was torn down.

iOS only. Multipeer Connectivity does not survive suspension, so the plugin tears the session down on backgrounding rather than reporting connections it no longer has. Distinct from SessionStopped, which is the application asking: only one of the two is worth telling a user about, and only one is worth re-arming from.

Canceled = 1

The caller withdrew before the handshake completed, by canceling the CancellationToken it passed.

ClosedLocally = 6

The local application ended the connection, through DisconnectAsync() or CloseAsync().

Declined = 0

The local device declined an inbound connection request, through DeclineAsync(CancellationToken).

Failed = 4

The handshake failed for any other reason.

LostFromDiscovery = 8

A discovery pass no longer reports the device, so it left the device set.

PeerDisconnected = 5

An established connection ended without a local cause: the remote device closed it, or the link was lost. The platforms cannot tell those two apart, so neither does this plugin.

RequestExpired = 3

An inbound request was not answered before its offer deadline, so the plugin declined it.

Distinct from TimedOut, which is an operation the caller was awaiting. Nothing awaits an outstanding request, so this reason reports a withdrawn offer rather than a failed call.

SessionStopped = 7

The session stopped, StopAllAsync() or disposal, and ended the connection with it.

TimedOut = 2

The handshake did not complete within OfferWindow when this device initiated it, or before the offer's remaining window when it accepted.

This is distinct from Failed because the platforms differ: iOS has a native invitation timeout and Android has none, so the plugin supplies one on both. Collapsing the two would hide that asymmetry.