iOS Guides | Samples

MultipeerConnectivity.MCNearbyServiceAdvertiser Class

Provides programmatic control for advertising the device for multipeer connectivity.

See Also: MCNearbyServiceAdvertiser

Syntax

[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

Remarks

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

Requirements

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

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

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

Public Methods

StartAdvertisingPeer()
Begins advertising this peer device for connection.
StopAdvertisingPeer()
Stops advertising this peer device for connection.

Protected Methods

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