2014-03-13 34 views
0

這很奇怪,但直到昨天,我才能在我的應用中獲得gplus用戶的圖像,但今天它只是不來。什麼都不是空白。並在一段時間出現..無法獲取GPlus個人資料圖片。 Google Plus圖片抓取網址是否已更新?

我一直在使用Getting Google+ profile picture url with user_id指定的網址,但這些都似乎無效,並給出404錯誤

https://plus.google.com/s2/photos/profile/116018066779980863044?sz=100

如果有人可以幫助我爲什麼這種怪異的行爲。個人資料圖片很少出現。但大部分是空白的。

回答

1

你正在使用的圖像URL從來就不是一個公共的API,因此無法保證它會繼續工作。今後推薦的做法是使用API​​方法來取代profile =>image =>url值。如果用戶更改其頭像,那麼該網址可能會停止工作,因此您可能需要獲取實際圖片並將其緩存到自己的服務器上。

+0

謝謝@abraham ... – Kailas

0

我認爲圖片網址已被更新。

中序得到的是,我們可以使用PlusClient對象的方法:

imageURL = mPlusClient.getCurrentPerson().getImage().getUrl() 
{Returns a String - Image Url as String} 

imageURL = mPlusClient.getCurrentPerson().getImage() 
{Returns an instance of Image object} 
相關問題