Latest 0.1.0
Homepage https://github.com/makeandship/MSServerSentEvents
License MIT
Platforms ios 8.0, requires ARC
Dependencies libextobjc/EXTScope
Authors

CI Status
Version
License
Platform

An Objective-C implementation of Server-Sent Events

Usage

Simply initialise an event source and then subscribe to receive events:

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:@"http://127.0.0.1:8888/"];

MSServerSentEventsSource *serverSentEventsSource = [[MSServerSentEventsSource alloc] initWithRequest:request receive:^(MSServerSentEvent *event) {
    NSLog(@"received:%@",event);
}
completion:^{
    NSLog(@"closed");
}
failure:^(NSError *error) {
    NSLog(@"error:%@",error);
}];

[serverSentEventsSource addListenerForEvent:@"open" usingBlock:^(MSServerSentEvent *event) {
    NSLog(@"received open event");
}];

[serverSentEventsSource addListenerForEvent:@"message" usingBlock:^(MSServerSentEvent *event) {
    NSLog(@"received message event");
}];

Installation

MSServerSentEvents is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "MSServerSentEvents"

Author

Simon Heys, [email protected]

License

MSServerSentEvents is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "MSServerSentEvents",
    "version": "0.1.0",
    "summary": "A native Objective-C implementation of Server-Sent Events",
    "description": "                       Improve your iOS appu2019s user experience and utility with our open-source, standards-based real-time data libraryn",
    "homepage": "https://github.com/makeandship/MSServerSentEvents",
    "license": "MIT",
    "authors": {
        "Simon Heys": "[email protected]"
    },
    "source": {
        "git": "https://github.com/makeandship/MSServerSentEvents.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/makeandship",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "MSServerSentEvents": [
            "Pod/Assets/*.png"
        ]
    },
    "dependencies": {
        "libextobjc/EXTScope": [
            "~> 0.4"
        ]
    }
}

Pin It on Pinterest

Share This