iOS Guides | Samples

MultipeerConnectivity.MCNearbyServiceBrowser Class

Allows programmatic browsing for devices advertising for multipeer connetivity.

See Also: MCNearbyServiceBrowser

Syntax

[Foundation.Register("MCNearbyServiceBrowser", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 10, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 10, ObjCRuntime.PlatformArchitecture.Arch64, null)]
public class MCNearbyServiceBrowser : NSObject

See Also

Remarks

Multipeer connectivity's discovery phase involves two roles: browsing and advertising. When an application searches for peers with which to connect, it is browsing. Browsing may be controlled by either a MCBrowserViewController or can be fully customized with a MCNearbyServiceBrowser. For a discussion of the discovery process, see the remarks for MCSession.

Related content

Requirements

Namespace: MultipeerConnectivity
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of MultipeerConnectivity.MCNearbyServiceBrowser are listed below.

See Also: NSObject

Public Constructors

Constructs a browser for the specified serviceType protocol, identifying the local peer as myPeerID.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

[read-only]
override
ClassHandleIntPtr. The handle for this class.
DelegateIMCNearbyServiceBrowserDelegate. An instance of the MultipeerConnectivity.IMCNearbyServiceBrowserDelegate model class which acts as the class delegate.
[read-only]
MyPeerIDMCPeerID. The identity of the local peer.
[read-only]
ServiceTypeString. The network protocol being browsed for.
WeakDelegateNSObject. An object that can respond to the delegate protocol for this type

Public Methods

InvitePeer(MCPeerID, MCSession, NSData, Double)
Invites a remote peer to join the session.
StartBrowsingForPeers()
Starts browing for local peers advertising for the MCNearbyServiceBrowser.ServiceType.
StopBrowsingForPeers()
Stops browsing for peers.

Protected Methods

override
Dispose(Boolean)
Releases the resources used by the MCNearbyServiceBrowser object.