开发者

Which way to go for reading public data using Graph API?

I am currently developing an app that's going to show a Facebook page's events in one tab. Now I'm struggling with facebook's graph API and I think I just need some more explanation about how the whole thing is meant to be.

I registered an app and got my app id, app secret and an access token. Generally it works by using my app id and the access token. But from what I've read there are two drawbacks with that.

  1. The token expires.
  2. There seems to be only one token at a time.

If the token expires I need to re-authenticate my app whenever the session is not valid any more. But - what's the correct way to do that? Is it by sending the request method by adding my data to the params dictionary?

And if there can only be one app access token at a time, will it result in conflicts when multiple clients are going to connect?

I want my app to just read pu开发者_StackOverflow中文版blic data, so authenticating a user is a no-go, as its simply not needed (I hope). But the more I think about it the more I think that using an app's token is not the correct way either.

How is this generally achieved? Do I need a wrapper web app to implement reading public event data?

Thanks for your help

  • Arne


I've never had a problem using one app token with multiple users.

As for expiring tokens, you can request a generic token, which should be sufficient for retrieving public data, by sending a GET request to:

https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜