MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer 方法

定义

指示已收到加入会话的邀请。

[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

参数

peerID
MCPeerID
context
NSData

内容待定。

此参数可以为 null

invitationHandler
MCNearbyServiceAdvertiserInvitationHandler

应用开发人员必须调用的延续。

实现

属性

注解

重写此方法时,应用程序开发人员必须调用 invitationHandler,传入相应的 MCSession 布尔值,指示是否应接受邀请。

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

适用于