Error while sending message using xmpp4r_facebook
Posted
by
santu
on Stack Overflow
See other posts from Stack Overflow
or by santu
Published on 2012-10-12T15:25:11Z
Indexed on
2012/10/12
15:37 UTC
Read the original article
Hit count: 276
I am following the instructions presented in http://dalibornasevic.com/posts/35-how-to-send-private-messages-with-facebook-api to send message to my friend and currently testing from command line. Following is the code I am using
require 'xmpp4r_facebook'
id = '<my facebook id>@chat.facebook.com'
to = '<my friend facebook id>@chat.facebook.com'
body = "hello, Im not spam!"
subject = 'message from ruby'
message = Jabber::Message.new to, body
message.subject = subject
client = Jabber::Client.new Jabber::JID.new(id)
client.connect
client.auth_sasl(Jabber::SASL::XFacebookPlatform.new(client, '<App ID>', '<access token got from https://developers.facebook.com/tools/explorer>', 'App Secret'), nil)
I get the error
RuntimeError: not-authorized
from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/xmpp4r_facebook-0.1.1/lib/xmpp4r_facebook.rb:103:in `auth'
from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:171:in `auth_sasl'
from (irb):12
from /Users/apple/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
© Stack Overflow or respective owner