iOS Guides | Samples

MultipeerConnectivity.MCNearbyServiceAdvertiser Class

Provides programmatic control for advertising the device for multipeer connectivity.

See Also: MCNearbyServiceAdvertiser


[Foundation.Register("MCNearbyServiceAdvertiser", 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 MCNearbyServiceAdvertiser : NSObject

See Also


Multipeer connectivity's discovery phase involves two roles: browsing and advertising. When an application makes itself available for connection, it is advertising. Advertising may be controlled by either a MCAdvertiserAssistant or can be fully customized with a MCNearbyServiceAdvertiser. For a discussion of the discovery process, see the remarks for MCSession.

Related content


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

The members of MultipeerConnectivity.MCNearbyServiceAdvertiser are listed below.

See Also: NSObject

Public Constructors

Creates an object identified as myPeerID for the specific serviceType.

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

ClassHandleIntPtr. The handle for this class.
DelegateIMCNearbyServiceAdvertiserDelegate. An instance of the MultipeerConnectivity.IMCNearbyServiceAdvertiserDelegate model class which acts as the class delegate.
DiscoveryInfoNSDictionary. A small dictionary of data available to aide peer discovery and negotiation.
MyPeerIDMCPeerID. The identity by which this device will be known on the peer network.
ServiceTypeString. The network protocol this peer supports.
WeakDelegateNSObject. An object that can respond to the delegate protocol for this type

Public Methods

Begins advertising this peer device for connection.
Stops advertising this peer device for connection.

Protected Methods

Releases the resources used by the MCNearbyServiceAdvertiser object.