iPhone contact's image
I would like to make frequently changes for the contact's image on the iPhone. This app: Photo Phonebook, did it with facebook profile pictures.
In the app, there are automatics updates of contact's image:
Next time a Facebook friend calls, their Facebook photo appears on your iPhone. It also appears in the address book. When your friends change their profile photos on Facebook, they change on your iPhone as well.
Because there's no background processing for syncing contact images on the iPhone, I assume that they used some kind of a link or 'pointer' to the fb image.
Is i开发者_运维问答t possible to put a link to image instead of the image itself? and every time the user access the same contact, the image is loaded from external link?
Checkout this post on Asynch Image View. I have used this code and it works well.
AsyncImageView derives from UIView and asynchronously fetches the image at the configured URL.
I think that it is really possible. Our application did the same. We store the link to the Facebook photo. Whenever, user need to view the photo, we downloaded it. You can use asynchronous method like Cannoade's suggestion or just write some few multithreaded code yourself to do asynchronous. That's easy.
Another suggestion is that you should cache your image and when you need to get the new photo, check your image's link to see if the avatar has been changed. Facebook changes the user's avatar link whenever user changes the avatar so if you check the link, you can know if the cache is out of date not.
精彩评论