Im looking for a solid and working XMPP gem for rails 3.2

There are hundreds of them in the net, but most of them outdated or alpha.

Can you recommend me one for rails 3.2?

有帮助吗?

解决方案

The gem xmpp4r works fine. (https://github.com/ln/xmpp4r)

Here is an example:

require 'xmpp4r'

sender_jid = Jabber::JID.new('a@b.com')
client = Jabber::Client.new(sender_jid)
client.connect('talk.google.com')
client.auth('password')

client.send(Jabber::Presence.new.set_show(:chat)).set_status('my status')

receiver_jid = Jabber::JID.new("dest@domain.com")
message = Jabber::Message::new(receiver_jid, "Testing").set_type(:normal).set_id('1')
client.send(message)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top