Latest 0.0.3
Homepage https://github.com/val-bubbleflat/laravel-echo-ios
License MIT
Platforms ios 9.0
Authors ,

Laravel Echo IOS

This is a project by Bubbleflat : find your perfect roommate and flatsharing

This project is wrapper to use Laravel Echo in Swift IOS project

This only work for socket.io, NOT FOR PUSHER yet !

Installation

This module can be imported with CocoaPods

pod 'LaravelEchoIOS'

Example

First, you need to import the framework :

import LaravelEchoIOS

Then you can use it like in javascript ( but you need to wait for the socket to be connected )

let token = "Auth token"
let e : Echo = Echo(options: ["host":"http://localhost:6001", "auth": ["headers": ["Authorization": "Bearer " + token]]])

e.connected(){ data, ack in

    print("CONNECTED")

    e.join(channel: "conversation.243").listen(event: ".NewMessage", callback: { data, ack in

        print(data)

    })

}

Documentation

See full Echo documentation for all available methods

All callback must been use like this :

e.connected(){ data, ack in

  // Do something when call

}

Or with a function like this

func listener(data: [Any], ack: SocketAckEmitter)

here, joining, leaving are not available yet

Latest podspec

{
    "name": "LaravelEchoIOS",
    "version": "0.0.3",
    "summary": "A wrapper for Laravel Echo in Swift",
    "description": "A wrapper for Laravel Echo with Socket.io in Swift by bubbleflat.com",
    "homepage": "https://github.com/val-bubbleflat/laravel-echo-ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Valentin Vivies": "[email protected]",
        "bubbleflat": "[email protected]"
    },
    "source": {
        "git": "https://github.com/val-bubbleflat/laravel-echo-ios.git",
        "tag": "0.0.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": [
        "LaravelEchoIOS/*.swift",
        "LaravelEchoIOS/**/*.swift"
    ],
    "exclude_files": "",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "pushed_with_swift_version": "4.0",
    "subspecs": [
        {
            "name": "Socket.IO-Client-Swift",
            "dependencies": {
                "Socket.IO-Client-Swift": []
            }
        }
    ]
}

Pin It on Pinterest

Share This