mirror of
https://github.com/zhigang1992/FayeObjC.git
synced 2026-01-12 17:22:33 +08:00
Adding README
This commit is contained in:
59
README.rdoc
Normal file
59
README.rdoc
Normal file
@@ -0,0 +1,59 @@
|
||||
= FayeObjC
|
||||
|
||||
A simple Objective-C client library for the Faye publish-subscribe messaging server. FayeObjC is implementing on top of the zimt Objective-C web socket library and will work on both Mac and iPhone projects.
|
||||
|
||||
= Working with the library
|
||||
|
||||
Initialize a Client:
|
||||
// init the FayeClient with a server and channel to subscribe to
|
||||
FayeClient *faye = [[FayeClient alloc] initWithURLString:@"ws://localhost:8000/faye" channel:@"/chat"];
|
||||
faye.delegate = self; // ensure that you implement the FayeClientDelegate functions
|
||||
// connect to the server
|
||||
[faye connectToServer];
|
||||
|
||||
Implement the FayeClientDelegate:
|
||||
- (void) messageReceived:(NSDictionary *)messageDict {
|
||||
DLog(@"message received");
|
||||
// do something useful with the message dictionary
|
||||
}
|
||||
|
||||
- (void)connectedToServer {
|
||||
// Faye connection established
|
||||
}
|
||||
|
||||
- (void)disconnectedFromServer {
|
||||
// Faye disconnected
|
||||
}
|
||||
|
||||
= Example Project
|
||||
|
||||
Included in the repository is a sample XCode project for Mac that provides a simple client application for interacting with Faye servers. Try it out and have a look at the code for an illustration on the usage of the library.
|
||||
|
||||
Check out the Faye project here:
|
||||
* http://faye.jcoglan.com
|
||||
|
||||
|
||||
== License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2009-2010 James Coglan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Reference in New Issue
Block a user