Callbacks for connected/disconnected?

  • Question
  • Updated 3 years ago
Is there a way to get a notification when Beacon is connected and when it get's disconnected? Using the Javascript api?
Photo of Alan Queen

Alan Queen

  • 7 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 8
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
It'll be possible soon through the web hooks (that you configure under "My Account").

Getting notifications of user connects/disconnects in the browser hasn't been a requested feature. But I definitely could see the use case, I'll add it to our backlog.
Photo of Damian Del Rivero

Damian Del Rivero

  • 1 Post
  • 0 Reply Likes
Definitely , I'll need callbacks or notifications to the browswer when a user joins a channel or leaves it to make Beacon useful for my app.

Thanks.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Point taken.
Photo of Alan Queen

Alan Queen

  • 7 Posts
  • 0 Reply Likes
Actually my orignal question was about getting a notification when the current client connects/disconnects. Not about others. So when my page loads I tell Beacon to connect and listen, but I wanted to see if there's a way to know that the connection was successful before I start sending messages. And I see in the debug output sometimes it will say "dicsconnected/reconnecting" etc. So would be good to know when that happens.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
I see what you mean. I'll make sure to add that to our backlog.
Photo of kirlevon

kirlevon

  • 9 Posts
  • 0 Reply Likes
this would be very useful and webhooks too
Photo of Ludwig PetterssonLP

Ludwig Pettersson

  • 2 Posts
  • 0 Reply Likes
Any ETA for webhooks? Eagerly waiting to use them.
Also, will they tell me what channels the newly connected user is listening to?

Cheerio,
Ludwig
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
They'll be launched before the end of this month.

Currently, channel information is not sent with the webhooks.
Perhaps that could be arranged, we'll keep it in mind.
Photo of Ludwig PetterssonLP

Ludwig Pettersson

  • 2 Posts
  • 0 Reply Likes
Alright, I use channels heavily right now - I'd love to see that get added. Let me know if you need anyone to test it!

Cheers
Photo of Matt Huebert

Matt Huebert

  • 1 Post
  • 0 Reply Likes
In my account settings it still says "Webhooks coming soon". What is the current estimate? Is Beacon Push still under active development?
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Yes, however some other prioritizations have come in between. Next up for launch is the payment feature. Allowing you to send more than the beta limit of number of messages.
Photo of gimmeaphatbeatG

gimmeaphatbeat

  • 5 Posts
  • 0 Reply Likes
If the connection drops (due to the user's internet connection dropping or whatever), will Beacon automatically reconnect? It doesn't appear to be.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Yes, it should reconnect automatically. If not, it's a bug.
Photo of kirlevon

kirlevon

  • 9 Posts
  • 0 Reply Likes
i have reconnection problem too, it simple doesn't reconnect
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Please open another issue describing your problem, including browser and version. Thanks!
Photo of Lee Wei Choong

Lee Wei Choong

  • 5 Posts
  • 0 Reply Likes
I sent some test content and monitored it on the message feed page. Then I went for dinner and came back, but when I began to send some messages again, they didn't turn up on the message feed. I had to refresh the message feed page. After how long of idle period will the connection be lost?
Photo of mrwebbM

mrwebb

  • 6 Posts
  • 1 Reply Like
Hi Lee, I had a similar issue here: http://getsatisfaction.com/esn/topics...

I also would love to see onConnect() and onDisconnect() exposed if possible, although the only reason I would want this is to do the reconnect, but assuming that beacon is reconnecting reliably I would not use it.

I'm running in debug mode for a while to see if I can see any clues in the logs to our issue.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Would be great if you could supply browser version and transport used when this occurs.

My guess is that this happens with the Flash WebSocket transport. Probably some firewall/router on the way decides the TCP connection is dead and possibly making an unclean shutdown. A better keep-alive/heartbeat should improve this situation.
Photo of Jeremy Rylan

Jeremy Rylan

  • 3 Posts
  • 0 Reply Likes
Are web hooks still on the roadmap for being released by end of summer? It will be super useful for my app, so I can keep an index of which users are online.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Yep, it's coming.
Photo of kkjf02

kkjf02

  • 1 Post
  • 0 Reply Likes
I'm waiting for Web Hooks to. It's very important to my application.
Photo of Rasmus Milesson

Rasmus Milesson

  • 3 Posts
  • 0 Reply Likes
Next summer? :/
Photo of eljeffoE

eljeffo

  • 16 Posts
  • 0 Reply Likes
I also would love to see onConnect() and onDisconnect() exposed if possible.

This way I could give the user a visual indicator of whether they are "connected" or not. Right now, the user has no idea.
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Noted.
Photo of Rvn

Rvn

  • 3 Posts
  • 0 Reply Likes
Hello, what is the status on this? I would like to get some notification on the server when a user disconnects without being a "unsubscribe" (i.e. connection dropped or browser closed or some unexpected issue...)...

We are evaluating several push solutions as well as implementing our own via socket.io or other solution... Self hosting is a good plus for beaconpush but this is a requirement... is this implemented? I see it "promised/mentioned" about a yr ago, always "coming next month" but no real confirmation?

Also, is there a manual except the few examples on the site for developers to look at all the functions?

Are we able to assign specific IDs to users/channels as a way to ease integration into an existing app? (basically since we already have an authenticated user, can I make him be ID {userid} and subscribe to channel Client{userid}, for example, where {userid} could be a id number or name from my existing platform? And would I be able to obtain said userid in the event of a lost connection (to remove him from my system as active)? We currently accomplish this with ajax but as we scale rapidly we are having some troubles and need to look at more scalable options.

Thanks! (Sorry this got kind of off topic... I found no other channel for pre-sales questions, etc...) oh, one final one: can I start development on the cloud/hosted version and then change to a self-hosted version once it is ready?
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Yes, the On-Site edition of Beaconpush supports this. You will get an event notification when a user disconnects. Does not matter if the disconnect was intentional or not. A user not returning within 30 seconds after losing the connection are considered offline.

Our On-Site edition is available as of now. More info is available at http://beaconpush.com/on-site.

You can assign unique IDs for your users. In fact, this is even what the Cloud version of Beaconpush does. It just has been simplified to cater the more common use-case where you don't care about the user ID.

You can of course use the Cloud version for development. But since we're discontinuing that edition I recommend you using the On-Site edition instead.
That version is available for evaluation purposes and can be used freely during development.
Photo of Rvn

Rvn

  • 3 Posts
  • 0 Reply Likes
Thank you. I sent an e-mail and filled out the form on your site for the on-site version. I hope you received it. Please let me know if not I will resend it. I posted some additional concerns such as high availability and how we can purchase multiple licenses to setup more than one server for failover...

thks.
Photo of Rvn

Rvn

  • 3 Posts
  • 0 Reply Likes
ok, got the email... continuing from there.