Facebook profile pictures
Is there an obvious reason why my Facebook profile url: "http://graph.facebook.com/1790785454/picture?type=normal" does not display with Fresco? It works in UIL, I am using the code from the getting started page (http://frescolib.org/docs/getting-started.html), and the sample URL "http://frescolib.org/static/fresco-logo.png" is fine so I know the issue is to do with the URL.
Uri uri = Uri.parse("http://graph.facebook.com/1790785454/picture?type=normal"); SimpleDraweeView draweeView = (SimpleDraweeView) rootView.findViewById(R.id.details_profile_drawee); draweeView.setImageURI(uri);
My guess is the path redirects somewhere crazy so Fresco doesn't know what to do.
Yes, the default network fetcher provided by Android doesn't handle redirections automatically. We do provide OkHttp integration for Fresco, which does that. See http://frescolib.org/docs/using-other-network-layers.html#_
Okay I shall experiment with OKHttp. Tell me at least you find it amusing that a FB library does not support FB open graph profile urls whereas UIL does :)
We don't use OkHttp nor HttpURLConnection within the Facebook apps. But in order to be able to open source Fresco as a complete solution, we provided two additional network fetchers:
- A simple one that is built on top of
HttpURLConnectionand doesn't require any additional networking library, but also has limitations such as inability to cancel the network request or to handle redirections properly. - A wrapper around OkHttp that supports cancellation and handles redirections, but has other limitations.
If neither of those two network fetchers are sufficient for you, you are welcome to implement your own :) Plugging OkHttp fetcher shouldn't be difficult and it solves the problem you have.
Should be fixed in 0.5.1.