Facebook接口

2022-06-14  本文已影响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 分享

配置应用域名

上一篇 下一篇

猜你喜欢

热点阅读