How to authorize Facebook app using redirect in canvas?

前端 未结 4 1615
猫巷女王i
猫巷女王i 2020-12-08 12:30

I\'m trying to get into making Facebook apps but I\'m having trouble getting authorization working in a redirect scheme inside the canvas.

Using the javascript api,

4条回答
  •  萌比男神i
    2020-12-08 13:02

    Using FB Javascript SDK, it can be done something like --

    FB.getLoginStatus(function(response) {
          if (response.status === 'connected') {
             loggedIn(response);
          } else {
            top.location = encodeURI("https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_APP_URI&response_type=token");
          }
    

提交回复
热议问题