How to download a file uploaded to a private Faceb

2019-07-05 05:14发布

Facebook now allows us to upload arbitrary types of files to Facebook groups, which is great. I am writing a single-sign-on iOS app, which accesses such a private group the user belongs to, and download those files.

I was able to acquire the URL to those files using Graph API, which look like this:

http://www.facebook.com/download/444555666777888/foo.bar

(If I type this URL to a browser, the browser downloads it as long as I have logged in to Facebook as me from that browser, but will fail otherwise -- Facebook has a good security feature).

I can't pass this URL to graph API because it's not part of graph (which always starts with https://graph.facebook.com/), but I can't download it using a regular NSURLConnection because of the lack of access token.

Is there any proper way to download those files? Or, is there any particular HTTP header I need to set when downloading such a file using NSURLConnection?

0条回答
登录 后发表回答