CanIODelegate
Protocol Overview
This protocol is conformed to by CanIOManager's delegate. This protocol is used to notify your app about newly discovered peers and new information about peers, and for incoming requests and responses.
Methods
- (void)canioManager:(CanIOManager *)manager didDiscoverPeer:(CanIOPeer *)peer;
- (void)canioManager:(CanIOManager *)manager didLosePeer:(CanIOPeer *)peer;
These delegate methods are called when peer is discovered or lost. Any discovered peer will be also be added to CanIOManager's peers array, but your app should also retain a reference to any peer objects that it wishes to interact with.
- (NSDictionary *)canioManagerProfileForLocalPeer:(CanIOManager *)manager;
This method is called when a new peer is discovered, allow your app to provide an NSDictionary object describing your local peer's profile. This information will then be accessible by the newly discovered peer. You may include any JSON-encodable data within your NSDictionary.
- (void)canioManager:(CanIOManager *)canioManager didUpdateProfileForPeer:(CanIOPeer *)peer;
This method is called when a peer's profile information is available, or when new information is available within the profile.
- (void)canioManager:(CanIOManager *)canioManager didUpdateSpacesForPeer:(CanIOPeer *)peer;
This method is called when a peer's spaces information has been updated. This method may be called when a peer has created or deleted a space, or changed the space's basic properties such as its title.
- (void)canioManager:(CanIOManager *)manager didReceiveRequest:(CanIORequest *)request fromPeer:(CanIOPeer *)peer;
- (void)canioManager:(CanIOManager *)manager didReceiveResponse:(CanIOResponse *)response forRequest:(CanIORequest *)request;
These delegate methods are called when a new request or response is receivied from a peer. For an incoming request, the relevant peer object is also supplied. For an incoming response, the related request is included, which also includes the relevant peer.