iOS Guides | Samples

MultipeerConnectivity.MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer Method

Indicates an invitation has been received to join a session.

Syntax

[Foundation.Export("advertiser:didReceiveInvitationFromPeer:withContext:invitationHandler:")]
[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
public abstract Void DidReceiveInvitationFromPeer (MCNearbyServiceAdvertiser advertiser, MCPeerID peerID, NSData context, [ObjCRuntime.BlockProxy(typeof(ObjCRuntime.Trampolines/NIDMCNearbyServiceAdvertiserInvitationHandler))] MCNearbyServiceAdvertiserInvitationHandler invitationHandler)

Parameters

advertiser
peerID
context
invitationHandler
Continuation that the app developer must call.

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.

C# Example

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

Requirements

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