Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Haris Amin
    @hamin
    @aymericbouzy the source for the example project is in the git repo https://github.com/hamin/FayeSwift
    in the Example folder
    Aymeric Bouzy
    @aymericbouzy
    Thank you so much, I'm new to cocoapods, i didn't know the pod try command. Sorry about that.
    Haris Amin
    @hamin
    no worries
    just so you know that's optional. not all pods have an example project that works with "pod try" like that
    it is encouraged though
    Aymeric Bouzy
    @aymericbouzy
    Ok thanks for the advice.
    Haris Amin
    @hamin
    np :)
    Aymeric Bouzy
    @aymericbouzy
    My code is not working at the moment and it looks like I did someting similar to what you have in your example. I'm not using a ws protocol though, but http : could that be a reason for the error I get after about 30 seconds ? websocket lost connection! Transport websocket lost connection!
    i'm using the rails faye server
    curl http://localhost:9292/faye -d 'message={"channel": "/jobs", "data": "hello!"}' will be successful
    but i never get connected to the server when using FayeSwift
    Aymeric Bouzy
    @aymericbouzy
    at least, neither connectedToServer nor connectionFailed get called.
    Haris Amin
    @hamin
    This message was deleted
    @aymericbouzy you have to use the websocket url, currently FayeSwift only supports the websocket transport. If you take a look at the example you can see that you should use the 'ws' url like so: ws://localhost:5222/faye or in your case ws://localhost:9292/faye
    Aymeric Bouzy
    @aymericbouzy
    I'm looking into the faye-websocket gem at the moment.
    Haris Amin
    @hamin
    you don't have to change anything on your faye serve
    just in your iOS code using the FayeSwift client specify the url like so : ws://localhost:5222/faye
    the faye server supports multiple transports, web sockets, long polling, callback polling, evensource
    but the FayeSwift client currently only supports the websocket transport
    again you don't have to change anything on the Faye server
    Aymeric Bouzy
    @aymericbouzy
    I assumed from http://faye.jcoglan.com/ruby/websockets.html that I had to use a different gem.
    Haris Amin
    @hamin
    do you have your faye server running?
    if you do then just change the URL in the iOS code to use 'ws'
    as i mentioned
    Aymeric Bouzy
    @aymericbouzy
    ok I'm going to try again, I think I tried earlier today. Thanks a lot for your help by the way!
    Haris Amin
    @hamin
    :thumbsup:
    Aymeric Bouzy
    @aymericbouzy
    I get more output when using the faye-websockets server than the faye one in the XCode console

    faye-websocket:

    websocket is connected
    Transport websocket is connected
    got some text: {"channel":"\/meta\/handshake","version":"1.0","minimumVersion":"1.0beta","supportedConnectionTypes":["long-polling","callback-polling","iframe","websocket"]}
    Transport got some text: {"channel":"\/meta\/handshake","version":"1.0","minimumVersion":"1.0beta","supportedConnectionTypes":["long-polling","callback-polling","iframe","websocket"]}
    Missing channel
    unsub
    resub

    faye:

    unsub
    resub
    This is obtained by using your example app, not mine.
    I assume you use the node.js faye server?
    Haris Amin
    @hamin
    yeah i was using the node.js faye server, but really should work just fine with the ruby one too
    Aymeric Bouzy
    @aymericbouzy
    I'm getting much more output with the node.js faye server :
    websocket is connected
    Transport websocket is connected
    got some text: [{"channel":"/meta/handshake","successful":true,"version":"1.0","supportedConnectionTypes":["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","advice":{"reconnect":"retry","interval":0,"timeout":45000}}]
    Transport got some text: [{"channel":"/meta/handshake","successful":true,"version":"1.0","supportedConnectionTypes":["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","advice":{"reconnect":"retry","interval":0,"timeout":45000}}]
    HANDSHAKE_CHANNEL
    Connected to Faye server
    got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/cool"}]
    Transport got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/cool"}]
    SUBSCRIBE_CHANNEL
    Subscribed to channel /cool
    got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/awesome"}]
    Transport got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/awesome"}]
    SUBSCRIBE_CHANNEL
    Subscribed to channel /awesome
    unsub
    resub
    got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/unsubscribe","successful":true,"subscription":"/awesome"}]
    Transport got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/unsubscribe","successful":true,"subscription":"/awesome"}]
    UNSUBSCRIBE_CHANNEL
    Unsubscribed from channel /awesome
    got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/awesome"}]
    Transport got some text: [{"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s","channel":"/meta/subscribe","successful":true,"subscription":"/awesome"}]
    SUBSCRIBE_CHANNEL
    Subscribed to channel /awesome
    Original: 1
    Encoded:  Optional("MQ==")
    Decoded:  Optional(1)
    THIS IS THE PUBSLISH STRING: {"channel":"\/cool","id":"1","data":{"text":"Mqljsdflmqjsdmlfqjsdmflq"},"clientId":"ierfto70jzenxc6n1rvjk1ypzhjbr3s"}
    got some text: [{"channel":"/cool","id":"1","data":{"text":"Mqljsdflmqjsdmlfqjsdmflq"}}]
    Transport got some text: [{"channel":"/cool","id":"1","data":{"text":"Mqljsdflmqjsdmlfqjsdmflq"}}]
    New Message on /cool
    Here is the message: Opt
    
    ...
    Haris Amin
    @hamin
    this is the ruby server https://rubygems.org/gems/faye
    Aymeric Bouzy
    @aymericbouzy
    Yes it's the one I'm using. Did you test it?
    Did you check the link I gave you earlier? http://faye.jcoglan.com/ruby/websockets.html
    Aymeric Bouzy
    @aymericbouzy
    I'll be using the node.js server for now, no problem. Adding support for the rails server would be really nice though :)
    Aymeric Bouzy
    @aymericbouzy
    Hi Hamin, I have an issue : although I get the message Transport got some text: [{"channel":"/cool","data":{"text":"hello world!"},"id":"1x"}] in console, the method messageReceived is never called. I'm using your example app for that. Have you tested your code for that part?
    Aymeric Bouzy
    @aymericbouzy
    I'm using block channel now, seems to work better. what is message received for then?
    Haris Amin
    @hamin
    FayeClient provides a block based api and a delegate based api. You could just use the delegate without the block. Currently there's a bug (feature ;) ) that for channel subscriptions, if you have block handlers only block handler will get called and not the delegate method messageReceved isn't. In my mind that made sense. Not sure if it makes sense to send messages through both apis but I'm still thinking about it
    Aymeric Bouzy
    @aymericbouzy
    I was subscribing to channels without any block, and the delegate method messageReceived wasn't ever called. But the API you're describing to me makes sense I guess. I had not understood from your documentation there were two parallel ways of doing, but then I never read documentations fully ...
    Haris Amin
    @hamin
    just bump pod to 0.2.0 with some api improvements a crash fix
    Daniel Que
    @dmdque
    will fayeswift work with swift 3.0?
    I'm also getting:
    ```[!] Unable to satisfy the following requirements:
    • SwiftyJSON (~> 3.1) required by Podfile
    • SwiftyJSON (= 3.1.0) required by Podfile.lock
    • SwiftyJSON (~> 2.3) required by `FayeSwift (0.1.1)````
      Is it possible to have two different versions of a library with cocoapods?
    Daniel Que
    @dmdque
    hey @hamin, is it possible to get FayeSwift working with swift 3?
    Tim Hansen
    @willc0de4food_twitter
    Evening, all
    Is anyone aware if it's possible to send additional parameters when connecting to a channel?
    Tim Hansen
    @willc0de4food_twitter
    @hamin any input?
    Punita Ojha
    @punitaojha
    This message was deleted
    Haris Amin
    @hamin
    wow just logging on here after a long while @dmdque @willc0de4food_twitter FayeSwift has been swift 3 ready for a while...sorry for the late response :) i barely come on bitter anymore