开发者

Is authentication required for Facebook Apps?

I don't use Facebook, so at a bit of a loss here, as the API documentation doesn't quite answer this, perhaps someone here knows...

Looking at building a Facebook app to assist publishing from a content-driven web app. Obviously we need authorisation via OAuth to publish an app link to a facebook user's wall, but is authorization for everyone viewing the app within Facebook required? We have no interest in making use of the viewer's facebook data, we just want to show them a page.

If they have to authorise the app, then that's a bit of a barrier - but it's not clear if they can just view the app without anything getting开发者_Python百科 in the way.


"is authorization for everyone viewing the app within Facebook required?"

If you mean having your app post a link to their wall, then yes, you will need to ask for their permission to do so. If you mean can other friends can see the post made by your app to an authorized user's feed? No the friends do not need to authorize your app to do that.

But remember Facebook now has the ability for you to specify which groups can see the post. See https://developers.facebook.com/docs/reference/api/user/#posts and read about the privacy field.


Yes, you can show app without any authentication. If you want user to share content then you can do it like this. Code is few months old, so I don't know if that works. You cannot set custom text/message for the user. This will display popup window where user must confirm sharing/posting to wall.

<div id="fb-root"></div>

<script src='http://connect.facebook.net/en_US/all.js'></script>
<script type="text/javascript">

FB.init({appId: 'APP_ID', status: true, cookie: true});

function share(object) {

  var obj = {
    method: 'feed',
    link: 'http://apps.facebook.com/your_app_url/',
    picture: object.picture,
    name: object.name,
    caption: object.caption,
    description: object.description,
    action_links: [
        { text: 'My Cool App', href: 'http://apps.facebook.com/your_app_url/' }
    ]
  };

  function callback(response) {

  }

  FB.ui(obj, callback);

}

</script>


If you're doing a canvas app, you don't need to. You get this generic information in the initial HTTP post:

user        A JSON array containing the locale string, country string and the age object     (containing the min and max numbers of the age range) for the current user.
algorithm   A JSON string containing the mechanism used to sign the request.
issued_at   A JSON number containing the Unix timestamp when the request was signed.

You get no actual information about the user, though. You need to authenticate to get that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜