Domanda

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?

È stato utile?

Soluzione

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)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top