Edit

Share via


MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer Method

Definition

Indicates an invitation has been received to join a session.

[Foundation.Export("advertiser:didReceiveInvitationFromPeer:withContext:invitationHandler:")]
public abstract void DidReceiveInvitationFromPeer (MultipeerConnectivity.MCNearbyServiceAdvertiser advertiser, MultipeerConnectivity.MCPeerID peerID, Foundation.NSData context, MultipeerConnectivity.MCNearbyServiceAdvertiserInvitationHandler invitationHandler);
abstract member DidReceiveInvitationFromPeer : MultipeerConnectivity.MCNearbyServiceAdvertiser * MultipeerConnectivity.MCPeerID * Foundation.NSData * MultipeerConnectivity.MCNearbyServiceAdvertiserInvitationHandler -> unit

Parameters

peerID
MCPeerID
context
NSData

To be added.

This parameter can be null.

invitationHandler
MCNearbyServiceAdvertiserInvitationHandler

Continuation that the app developer must call.

Implements

Attributes

Remarks

When overriding this method, application developers must invoke the invitationHandler, passing in an appropriate MCSession and a boolean indicating whether the invitation should be accepted or not.

public override void DidReceiveInvitationFromPeer(MCNearbyServiceAdvertiser advertiser, MCPeerID peerID, NSData context, MCNearbyServiceAdvertiserInvitationHandler invitationHandler)
{
	parent.statusLbl.Text = "Received Invite";
  invitationHandler(true, parent.Session);
}              

Applies to