facebook-graph-api - 如何使用颤振从 facebook graph api 获得更好的个人资料图片
问题描述
我正在使用 http.get 获取用户的 fb 个人资料图片,但图片非常小且模糊,我怎样才能获得更好的图片?目前这是我获取图像并存储它的代码:
final token = result.accessToken.token;
final graphResponse = await http.get('https://graph.facebook.com/v3.3/me?fields=name,picture,friends,email&access_token=${token}');
final profile = JSON.jsonDecode(graphResponse.body);
print(profile);
setState(() {
userProfile = profile;
_isLoggedIn = true;
});
然后当我在我的数据库中设置数据时:
'photoUrl':userProfile["picture"]["data"]["url"],
图片非常小而且模糊,因为我在 url idk 中得到了 50 的宽度和高度,但是如何改变它呢?
解决方案
有关指定维度的示例 URL,请参见下文。
final graphResponse = await http.get(
'https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),first_name,last_name,email&access_token=${fbToken}');
这确实是一个 FB Graph API 问题,之前已在此处回答:获取全尺寸个人资料图片
推荐阅读
- html - 带有无限动画的css伪元素溢出身体
- laravel - Laravel 从blade.php 将数据插入数据透视表
- html - 如何仅表示月份
- sqlite - 将 str 转换为 datetime 并从 db 中获取所有数据
- python - 加载 RSA 公钥文件并在 Python 中转换为二进制数组?
- python-3.x - 新的 IDLE 不允许我左右移动排长队
- node.js - 为什么我不能在 Node.js 中使用 await 函数?
- python - 如何在 matplotlib 上绘制“igraph”对象时启用“cairo”后端?
- c++ - 最大化切割段
- javascript - webpack PurgeCSS webpack 插件未按预期工作