2011-09-05 7 views
0

を好きになって、それはすべてのページを取得し、ユーザーが好き:難しすべてのページのユーザーは、私はこのコードを使用

@user = session[:graph].get_object('me') 
    like = session[:graph].get_connections("me", "likes") 
    if !(like.to_s.include?('appid')) 
    redirect '/youneedlike' 
    end 

それは私と私の仲間のための作品ですが、一部のユーザーがエラーを持っている:彼らは常にリダイレクトされ、でも、彼らは私たちのページが好きです。

どういうところが間違っていますか?

答えて

2

アプリでuser_likespermissionをリクエストしていますか?

# pseudocode 
signed_request = decode signed_request() 
if signed_request['page']['liked']: 
    # user liked page, do something cool 
else: 
    # user doesn't like page. redirect somewhere to tell them why they should 
:あなたのアプリがキャンバスのアプリがある場合

あるいは、あなたは同じことを行うためにsigned_requestパラメータを使用することができます

関連する問題