Facebook API有針對email欄位寫下這段:
This person’s primary email address listed on their profile. This field will not be returned if no valid email address is available.
所以,跟臉書拿資料時,不要用email欄位來判斷是否從facebook拿到資料了,用id欄位。也不要直接用email欄位去判斷使用者是否註冊過。
真的硬要寫入email有一個solution:臉書就算不給你email,若是有回傳username就將email存[username]@facebook.com、
連username都沒有就存[id]@facebook.com
臉書會將收到的信轉寄給使用者信箱。
注意:不是存進臉書收件匣,是轉寄到使用者的主要信箱。臉書政策改過。
http://www.theverge.com/2014/2/24/5443454/facebook-retires-its-email-service
注意:經我測試,有username就不能寄信到[id]@facebook.com,會失敗。
根據國外開發者的回報,他們的會員大約有0.1% – 2%有這個情形。
大家都以為至少能從臉書拿到email,這導致了一個國際級常見bug吧。
臉書工程師的解釋如下:
There are a number of circumstances in which you may think a user should have an email address returned but they will not. For privacy and security reasons it is not possible to elaborate on the precise reason any specific user’s email address will not be returned so please do not ask.
Some possible reasons:
No Email address on account
No confirmed email address on account
No verified email address on account
User entered a security checkpoint which required them to reconfirm their email address and they have not yet done so
Users’s email address is unreachable
可以參見以下文章的討論:
http://stackoverflow.com/questions/9347104/register-with-facebook-sometimes-doesnt-provide-email
https://developers.facebook.com/bugs/298946933534016
https://github.com/mkdynamic/omniauth-facebook/issues/61
最後再強調一次:不要以為一定能從臉書撈到email資料
精選專案.網頁設計.RWD響應式網站.企業形象網站 / 休閒餐飲類
網站技術:PHP . Javascript/MySql
丹醇用最新鮮的原料製作最安心的商品,追求吃進身體裡面的食物與飲品都是健康、安全、無負擔。 網站主打線上訂購乳製品,簡易的下定流程,對於第一次使用的會員也不是問題,也能配合指定的時間抵達喔。
精選專案.網頁設計.RWD響應式網站.企業形象網站 / 環保類
網站技術:PHP . Javascript
各國提倡環境保護,從環境整潔、保護物種甚至是居住環境,本站致力於導入再生能源與綠建築。利用太陽能板、風力...等等增加更多能源。對於建築物來說題昌綠建築標章, 在選購家電上要挑選一級省電的標章也為環境出力。
網頁設計.RWD響應式網站.活動網站 / 建築設計類
網站技術:PHP/MySql
利用攝影的方式推廣綠建築,並加深民眾對於綠建築的知識與興趣。
參賽者與一般民眾也可透過此報名系統觀看台灣各地特色的綠建築,藉由比賽關係親臨與參觀。推動綠建築政策,宣導綠建築節能減碳。
電話:(02)2739-9096 | 傳真:(02)2739-6637 | 客服:[email protected] | 臺北市信義區和平東路3段257號6樓map
© 2019 傑立資訊 All rights reserved.| 網站隱私政策