MCNearbyServiceAdvertiserDelegate.DidReceiveInvitationFromPeer 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指示已收到加入会话的邀请。
[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
参数
- advertiser
- MCNearbyServiceAdvertiser
- peerID
- MCPeerID
- 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);
}