美文网首页
Facebook接口

Facebook接口

作者: 可乐菜鸟 | 来源:发表于2022-06-14 15:43 被阅读0次

1.H5 登录

1.1 使用jssdk登录

1.2 手动配置登录:类似于微信的先获取code,后获取access_token

前端获取code :【get】https://www.facebook.com/v14.0/dialog/oauth?client_id={appid}&redirect_uri={encodeURIComponent(redirect_uri)}&state={state}

服务器端获取access_token:【get】https://graph.facebook.com/v14.0/oauth/access_token?client_id={appid}&client_secret={secret}&redirect_uri={urlencode(redirect_uri)}&code={code}

注:redirect_uri:https://xxx.xxx.com/ [最后这个斜杠很重要,补全地址或带上斜杠]

服务器端获取用户ID:https://graph.facebook.com/me?access_token={access_token}

2. H5 分享

配置应用域名

相关文章

网友评论

      本文标题:Facebook接口

      本文链接:https://www.haomeiwen.com/subject/wdyzmrtx.html