簡體   English   中英

Ruby on Rails:當用戶未登錄我的應用程序時,如何使用facebooker2從用戶那里獲取個人資料圖片

[英]Ruby on Rails: how to use facebooker2 to get profile pictures from users when they are not logged in on my app

所以我在玩facebooker2。 我已經知道如何在當前用戶登錄時顯示他們的個人資料圖片。但是,我也有興趣在我的應用程序中顯示其他用戶的個人資料圖片。 我想知道是否有人知道該怎么做? 我已經請求離線許可,但是我不確定下一步將是什么。

有人可以給我一些提示嗎? 非常感謝你!

如果您需要小頭像,只需使用圖片標簽即可

<%= image_tag "http://graph.facebook.com/#{@user.facebook_id}/picture" %>

如果您具有用戶的Facebook uid,則可以顯示其圖片。 您不需要任何許可。

使用facebooker2,您可以將助手作為fb_profile_pic(facebookUserUid,OptionHash)

通過這種方式,以下代碼對我有效-

<%= fb_profile_pic(current_facebook_profile.id, {:size => 'square' }) %>

對於離線用戶-

<%= fb_profile_pic(user.fb_user_uid, {:size => 'square' }) %>

當我將Facebook uid存儲在fb_user_uid列中時。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM