在多对等框架中,如果发送者向接收者发送邀请并且接收者拒绝它。 那么有什么方法可以检查接收者拒绝邀请吗?
[self.browser invitePeer:peerID
toSession:self.session
withContext:nil
timeout:INVITE_TIMEOUT];
最佳答案
If you use one of the framework’s browser objects for peer discovery, when a peer accepts an invitation, the session calls its delegate object’s
session:peer:didChangeState:
method withMCSessionStateConnected
as the new state, along with an object that tells you which peer became connected.
并检查 session:peer:didChangeState:
documentation ,我看到了这个:
This delegate method is called with the following state values when the nearby peer’s state changes:
MCSessionStateConnected
—the nearby peer accepted the invitation and is now connected to the session.
MCSessionStateNotConnected
—the nearby peer declined the invitation, the connection could not be established, or a previously connected peer is no longer connected.
关于ios - 如何将接收方的 ACCEPT 和 DECLINE 操作通知发送方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50138064/