【问题标题】:Unable to fetch GPlus profile pic. Is the Google Plus Image fetch URL updated?无法获取 GPlus 个人资料图片。 Google Plus 图片获取 URL 是否已更新?
【发布时间】:2014-03-13 04:38:31
【问题描述】:

这很奇怪,但直到昨天我才能在我的应用程序中获取 gplus 用户的图像,但今天它只是没有出现。没有什么是空白的。并且只是在某个时间出现..

我一直在使用Getting Google+ profile picture url with user_id 中指定的 url,但这些似乎都无效并给出 404 错误

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

如果有人能帮我弄清楚为什么会出现这种奇怪的行为。个人资料图片很少出现。但大多数情况下它是空白的。

【问题讨论】:

    标签: android google-plus


    【解决方案1】:

    您使用的图片 URL 从来都不是公共 API,因此无法保证它会继续工作。推荐的做法是使用people.get API 方法来获取profile => image => url 值。如果用户更改他们的头像,该 URL 可能会停止工作,因此您可能希望获取实际图像并将其缓存在您自己的服务器上。

    【讨论】:

      【解决方案2】:

      我认为图片网址已更新。

      为了得到它,我们可以使用 PlusClient 对象方法:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多