TWRequest Caching - ios5

I use TWRequest in ios5 to fetch avatars for user accounts.
The returned image data doesn't seem to be cached. If I check the Cache.db sqlite database, there are records for all images, however, they contain no data.
Is there any easy way to enable caching of avatars (images) with TWRequest?

Related

Is it good idea to rotate (remove) firebaseStorageDownloadTokens?

My use case is that I want to stream a video which was uploaded to firebase storage.
My understanding is that when the video is first uploaded a firebaseStorageDownloadToken is created.
Then whenever in the client app I call getDownloadUrl a user gets access to the secret token and can technically share the url with others to watch or download.
I don't really need the long lived access or the videos to be shareable.
Isn't it then more secure to periodically refresh firebaseStorageDownloadTokens with a new value?
That would prevent the stolen urls from working.
And then if a user wants to watch same video again a new url through getDownloadUrl is obtained containing a new token.
Do you think it makes sense as a security measure?
What would happen if a firebaseStorageDownloadTokens is changed while I'm watching the video? Would the stream stop emitting?
While you can definitely revoke the default token, it isn't automatically shared with any users - so the chances of it being abused by them are pretty small. But: users that can upload through the Firebase SDK for Cloud Storage can also call getDownloadURL on the objects they upload and thus generate new tokens. If this is a significant concern for your use-case, you should probably not allow uploads through the Firebase SDK.
There (currently) is no way in the Firebase SDK to generate a URL that automatically expires. If you want that, consider using one of the Cloud SDKs for Cloud Storage, which have the option to generate so-called signed URLs that do precisely that.

Creating Albums on iCloud and storing different photos in each album using cloudKit Swift 4

I am new to iOS Development and I am creating this project where I need to use CloudKit in order to save photos on iCloud. So basically my app will allow user to create different photo albums and inside every album adding photos of his/her choice, the catch is user will only be able to see this adding album page when a secret password is entered on a separate page.
Basically I need some guidance from you guys in order to achieve this task. After searching online I came to know that i have to use CloudKit in order to integrate iCloud in my app.
Basically i am looking for answers to this following questions :
After integrating CloudKit what am I suppose to do?
How can i create different folders on iCloud and how can I possibly give unique ids to them?
How can I upload photos to specific album?
If someone has reference code to such app,it will be of great help.
looking forward to get my doubts cleared.

Is there an alternative to avatars.io?

As http://avatars.io seems to return 404 instead of already uploaded photos, and does not allow to upload new photos, I found myself in an inconvenient situation, where I have to move to a different service provider or implement my own avatars solution.
The latter (based on my experience from nk.pl) seems to be quite time consuming, and I do not want users of my website to wait for this basic functionality, so I'd really love to hear that there is some drop-in replacement for avatars.io.
I need a service which :
allows a user to upload a photo to the cloud (preferably directly from their browser using a js library)
stores the photo, resizes it, crops it to a square shape
after the upload returns a url which can be stored in the database and subsequently used to retrieve the avatar

Facebook loading multiple picture url for custom friend selector

I'm building a custom friend selector on mobile (Air, starling). I use the graph api to request invitable_friends which returns me everything i need.
My concern is about loading all these images. The basic strategy would be to loop over all the output and load all image separately.
First, i'm afraid that will be very slow and heavy for the user,
Second, i'm afraid facebook will blacklist the incoming connection if it gets too many calls.
So my question is, is there any specific strategy, as caching the images on the mobile harddrive to load them only once (and refresh once in a while)
Or does facebook another way to access all those data in a single request ?
Thanks

Best way to retrieve facebook profile images using MVC5 OWIN

I am using OWIN in mvc5 to authenticate users, but I want to show their profile pictures as well. I have searched on strackoverflow and found the following way to get it done.
This is for facebook & Google plus :
https://plus.google.com/s2/photos/profile/[USERID]?sz=100
http://graph.facebook.com/[USERID]/picture?type=square
Is this the best way to retrieve the images? Should we store images onto our server and load locally or we call these links every time someone logs in ? I need a proper approach, e.g. If we store them locally then they won't be updated if user changes their profile picture on facebook but if we load them every time from facebook then it takes some loading time to do a 302 redirect to actual image url.
If you're just trying to display the images on a website, I would just store the link your given from Facebook/Google when someone logs in to your site in a local database and use the URL as the image src on the website. Facebook and Google will be storing these images on fast CDNs, you might as well take advantage.
This will off load the image storage and the need to serve up images from your own site, reducing load and storage requirements.
Then every time a user logs into your site retrieve their profile pic urls again and store them to make sure they are up to date.