Latest 1.0.2
Homepage https://github.com/beat843796/MZFayeClient
License MIT
Platforms ios 6.0, requires ARC
Dependencies SocketRocket, Base64
Frameworks QuartzCore
Authors

MZFayeClient

Faye Client for iOS.
This project is an rewritten version of the Library made by pcrawfor there: https://github.com/pcrawfor/FayeObjC
Improved capture errors, added subscription blocks, ability to set the extension for channel.
Added auto connection reconnect, and many more…

How To Use

self.client = [[MZFayeClient alloc] initWithURL:[NSURL URLWithString:@"ws://localhost:9292/faye"]];

    [self.client subscribeToChannel:@"/server" usingBlock:^(NSDictionary *message) {
        NSLog(@"Server %@",message);
    }];

    [self.client subscribeToChannel:@"/browser" usingBlock:^(NSDictionary *message) {
        NSLog(@"Browser %@",message);
    }];

    [self.client connect];

Delagate

@protocol MZFayeClientDelegate <NSObject>
@optional

- (void)fayeClient:(MZFayeClient *)client didConnectToURL:(NSURL *)url;
- (void)fayeClient:(MZFayeClient *)client didDisconnectWithError:(NSError *)error;
- (void)fayeClient:(MZFayeClient *)client didUnsubscribeFromChannel:(NSString *)channel;
- (void)fayeClient:(MZFayeClient *)client didSubscribeToChannel:(NSString *)channel;
- (void)fayeClient:(MZFayeClient *)client didFailWithError:(NSError *)error;
- (void)fayeClient:(MZFayeClient *)client didFailDeserializeMessage:(NSDictionary *)message
         withError:(NSError *)error;
- (void)fayeClient:(MZFayeClient *)client didReceiveMessage:(NSDictionary *)messageData fromChannel:(NSString *)channel;

@end

Faye Server

If you can to run a Faye server to test the client, you can find all the information you need there: http://faye.jcoglan.com/
You can also run the faye.rb file under the Server directory:

gem install faye thin eventmachine

rackup faye.ru -s thin -E production
curl http://localhost:9292/faye -d 'message={"channel":"/server", "data":"hello"}'

Dependencies

SocketRocket

A conforming WebSocket (RFC 6455) client library maintained by Square,
https://github.com/square/SocketRocket

Base64

Objective-C Base64 Additions for NSData and NSString
https://github.com/ekscrypto/Base64

Requirements

MZFayeClient requires either iOS 6.x and above.

ARC

MZFayeClient uses ARC.

Contact

Michal Zaborowski

Twitter

Bitdeli Badge

Latest podspec

{
    "name": "MZFayeClientExtended",
    "version": "1.0.2",
    "summary": "Faye Client for iOS. Supports subscription blocks and error handling for received messages",
    "description": "Fork of MZFayeClient with some little bugfixes",
    "homepage": "https://github.com/beat843796/MZFayeClient",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Clemens Beat": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/beat843796/MZFayeClient.git",
        "tag": "1.0.2"
    },
    "source_files": "MZFayeClient/*.{h,m}",
    "frameworks": "QuartzCore",
    "requires_arc": true,
    "dependencies": {
        "SocketRocket": [
            "~> 0.4"
        ],
        "Base64": [
            "~> 1.0.1"
        ]
    }
}

Pin It on Pinterest

Share This