ヘルパーがいます。Facebook ファンページのリストを取得します。仕事に数日前、突然停止しました。ファンページを1つ取ったらやめます。次のエラーが表示されます。
type: OAuthException, code: 100, message: (#100) Invalid Connection [HTTP 400]
これは私のヘルパーです
def self.download_fanpages(user_id)
#API Facebook
@graph = Koala::Facebook::API.new(Client.find(user_id).access_token.to_s)
#download list of fanpage
for facebook_page in @graph.get_object("me/accounts/page")
@graphs = Koala::Facebook::API.new(facebook_page["access_token"])
@url = @graphs.get_object("me")
if @url['link'].index("facebook")
if !Fanpage.find_by_uid_and_user(facebook_page["id"],user_id)
@fb = Fanpage.new
@fb.user = user_id
else
@fb = Fanpage.find_by_uid(facebook_page["id"])
end
@fb.name = facebook_page["name"]
@fb.access_token = facebook_page["access_token"]
@fb.uid = facebook_page["id"]
@fb.url = @url['link']
#install or not install
if @graphs.get_object("me/tabs/"+APP_ID.to_s).count > 0
@fb.install = 1
else
@fb.install = 0
end
@fb.save
end
end
end
他の誰かが同様の問題を抱えていますか。それを解決する方法は?