-
Notifications
You must be signed in to change notification settings - Fork 13
/
PartyTime.podspec
47 lines (29 loc) · 1.98 KB
/
PartyTime.podspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Pod::Spec.new do |s|
s.name = "PartyTime"
s.version = "1.0.2"
s.summary = "A light wrapper around MultiPeer connectivity framework which allows apps to quickly connect people without invitations."
s.description = <<-DESC
This is a light wrapper around the MultiPeer connectivity framework which quickly connects devices without having to send or receive invites. Here's the quick setup:
Each device calls:
PLPartyTime *partyTime = [[PLPartyTime alloc] initWithServiceType@"MyApp"];
partyTime.delegate = self;
[partyTime joinParty];
Each device will get a callback when anyone connects or disconnects. Note that any device which joins the party with this service type will automatically join without sending or receiving invitations.
- (void)partyTime:(PLPartyTime *)partyTime peer:(MCPeerID *)peer changedState:(MCSessionState)state currentPeers:(NSArray *)currentPeers;
Then, anytime you want to send data, you can call a method to send to all connected users (peers) or an array of select peers.
- (BOOL)sendData:(NSData *)data withMode:(MCSessionSendDataMode)mode error:(NSError **)error;
- (BOOL)sendData:(NSData *)data toPeers:(NSArray *)peerIDs withMode:(MCSessionSendDataMode)mode error:(NSError **)error;
The clients receiving data get the callback:
- (void)partyTime:(PLPartyTime *)partyTime didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerID;
And that's it.
There are a few more features of this library, but I'll let you read through the documentation to find those specifically.
DESC
s.homepage = "https://github.com/plivesey/PLPartyTime"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Peter Livesey" => "[email protected]" }
s.platform = :ios, '7.0'
s.source = { :git => "https://github.com/plivesey/PLPartyTime.git", :tag => "1.0.2" }
s.source_files = 'PLPartyTime',
s.framework = 'MultipeerConnectivity'
s.requires_arc = true
end