MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer(MCNearbyServiceAdvertiser, MCPeerID, NSData, MCNearbyServiceAdvertiserInvitationHandler) MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer(MCNearbyServiceAdvertiser, MCPeerID, NSData, MCNearbyServiceAdvertiserInvitationHandler) 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

context
NSData NSData

To be added.

This parameter can be null.

invitationHandler
MCNearbyServiceAdvertiserInvitationHandler MCNearbyServiceAdvertiserInvitationHandler

Continuation that the app developer must call.

Implements

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