facebook开发的一些东西

1.获取长期有效的token
1)请求链接
local url = string.format(“https://graph.facebook.com/v7.0/oauth/access_token?grant_type=fb_exchange_token&client_id=%s&client_secret=%s&fb_exchange_token=%s&access_token=%s”,
“你的应用编号”,
“你的应用密钥”,
“登陆时获取到的token”,
“登陆时获取到的token”)

2)返回值
{
“access_token”: “xxxxxxxxxxxxxx”,
“token_type”: “bearer”,
“expires_in”: 5127264
}
access_token:令牌
token_type:类型
expires_in:有效时间

2.获取facebook头像
1)请求链接
local url = string.format(“https://graph.facebook.com/v7.0/me?fields=picture&access_token=%s”,“你的token”)
2)返回值
{
“picture”: {
“data”: {
“height”: 50,
“is_silhouette”: false,
“url”: “xxxxxxxxxxxxxx”,
“width”: 50
}
},
“id”: “xxxxxxxx”
}
url:头像url

3.其他
获取名字,ID,性别等等,都可以去图谱API探索工具中去测试,会有返回值,方便大家测试。
图谱API探索工具链接:https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Dpicture&version=v7.0

4."将你登入到此应用时出错,请稍后再试"的问题"
android下默认有个debug.keystore,在我们不设置签名文件时,不打包直接运行在设备上时会用这个。
facebook登陆时,调起app,会校验后台配置的keyhash,所以我们需要把这个默认的debug.keystore也加上,避免不用签名时直接连设备启动,导致出现“将你登入到此应用时出错,请稍后再试”
SHA值转换成hashkey:http://tomeko.net/online_tools/hex_to_base64.php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值