https://github.com/jpsim/mpcmultipeerclient
Wrapper around MultipeerConnectivity to simplify common use cases
https://github.com/jpsim/mpcmultipeerclient
Last synced: over 1 year ago
JSON representation
Wrapper around MultipeerConnectivity to simplify common use cases
- Host: GitHub
- URL: https://github.com/jpsim/mpcmultipeerclient
- Owner: jpsim
- License: mit
- Created: 2014-04-11T14:52:21.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-11T14:52:47.000Z (over 12 years ago)
- Last Synced: 2025-04-09T23:12:44.786Z (over 1 year ago)
- Language: Objective-C
- Size: 156 KB
- Stars: 15
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MPCMultipeerClient
Wrapper around `MultipeerConnectivity` to simplify common use cases.
**VERY EARLY WORK IN PROGRESS, USE AT YOUR OWN PERIL.**
## Usage
See the `remotecam` demo project for more usage examples.
### Advertise and respond to connect/disconnect/events
```objective-c
[MPCMultipeerClient advertiseWithServiceType:@"myservice"];
[MPCMultipeerClient onConnect:^(MCPeerID *peerID) {
// Connected :)
}];
[MPCMultipeerClient onDisconnect:^(MCPeerID *peerID) {
// Disconnected :(
}];
[MPCMultipeerClient onEvent:@"doTheThing" runBlock:^(MCPeerID *peerID, id object) {
// Do the thing
}];
```
### Browse and send events
```objective-c
[MPCMultipeerClient advertiseWithServiceType:@"myservice"];
[MPCMultipeerClient onConnect:^(MCPeerID *peerID) {
[MPCMultipeerClient sendEvent:@"doTheThing" withObject:nil];
}];
```
## TODO
* Integrate NSStreams
* Allow MCSessionSendDataUnreliable
* Allow setting encryptionPreference
* Master election
* Use better unique peer ID than their displayName
## License
MIT Licensed.