문제

Hi I'm want to use ruby on rails to create a facebook connect web site with full facebook integration (events API) can I use OmniAuth for authentication and facebooker to handle the facebook API together ?

Is facebooker up to date with the latest API changes in Facebook ? Can you recommend any good articles about the subject ?

Thanks Gady

도움이 되었습니까?

해결책

You can use Onmiauth to connect to facebook.

To specicie the permissions you will need from facebook, this snippet should solve your problem :

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, 'APP_ID', 'APP_SECRET',{:scope => 'email,offline_access, your,scope,you,want}
end

The using of Facebooker depends of the version of rails you are using.

Facebooker is not compatible with Rails3(It wasn't a couple of month ago)

But don't worry there some alternatives :

https://github.com/arsduo/koala
https://github.com/nsanta/fbgraph
https://github.com/nov/fb_graph

If you choose to use fb_graph, this snippet should retrieve your profile :

user = FbGraph::User.new('me', :access_token => session[:omniauth]["credentials"]["token"])

user.fetch

Hope it will help you

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top