Order of photo albums displayed by ALAssets library - iphone

I am using the ALAssets library to build a custom image picker controller (much like in the photos app). Specifically I'm using enumerateGroupsWithTypes to populate a list of albums so I can put them in a table. I'm noticing when using this method, it populates the list in reverse order as the photos app so the albums are displayed reversed. For example:
The photos app displays the albums this way:
My app displays the albums this way:
Obvious solution is for me to just add the albums to the front of my array instead of the back, however I wanted to know if this is the usual behavior or if this is a bug? "Test Row" and "Test Row 2" I created using the new option in ios5 that lets you create your own album in the photos app, but I wonder if you add albums through other ways (like through iPhoto which I'm unsure how to do), are they ordered correctly? Has anyone come across this?

It does not appear to be possible to change the order by which AssetsLibrary framework returns to the caller ALAssetsGroups.

Related

How To Get All Songs of An Artist on Spoitfy?

In their docs for getting top tracks on an artist they mention this:
The 10 maximum tracks are the ones displayed by the Spotify app. If you want to fetch more artist’s top tracks, an alternative way is to use Echo Nest song/search to accomplish this. It will accept a Spotify artist id for input and give you Spotify id’s in the output.
I'm pretty sure the Echo Nest Api no longer exists, so I am wondering if there is still a way to get songs of an artist other than just 10 of them?
Alternatively I was thinking of using Last.fm's Api to do it if Spotify no longer supports that functionality, if anyone has any other suggestions of how one could work around this that would be great! Thanks in advance.
I think you won't be able to achieve it in single API call in Spotify. However there's an alternative:
Request all albums of an artist (have a look here):
https://api.spotify.com/v1/artists/{id}/albums
And then request the tracks of each album (have a look here):
https://api.spotify.com/v1/albums/{id}/tracks
To avoid one request for each album, you can get multiple albums at once and when an album is requested, the tracks of such album will be returned in a paging object. You can pass the desired albums identifiers separated by , in the id query parameter to the following endpoint (have a look here):
https://api.spotify.com/v1/albums
A solution that was more sufficient for me here was:
https://api.spotify.com/v1/search?type=track&q=artist:ArtistName
this returns the top songs by this artist, with pagination so definitely more than 10 results.
The only caveat is that this includes songs that the artist might be featured on, but I think this is useful really as if it's a popular song your user might be looking for it.

Creating a Photo Stream

I want to use the graph api to create a photostream of all the users friends photo's. How do you create a thing like that using the graph api. I guess in essence I want to create a chronological photo album of all my friends photos.
How should I go about accomplishing this.
You should start by getting the user's friends using /me/friends. Then you can cycle through the list of friends and get their photos like:
<img src="http://graph.facebook.com/{friend_id}/picture" />
You can use a JavaScript library to do the animation...
I eventually solved this by saving the entire image collection of a facebook user in the app's database and querying them SORT BY datetime.

How do I get all uploaded video from my user account in iPhone

I have scenario that I would like to have all video, uploded from my user account in TableView . I don't want other video. I know about to get the video using searching keyword. But I want it which are uploaded through my account only.
I passed through many things and search on it but can't get it.
You can use flag variable which is set to true when video is uploaded from your account. And when you request for list of video pass the parameter to send list of only uploaded videos.
When I read your question I wonder 3 things:
What type of account are you referring to?
To where is the video uploaded, and how?
Do I make a correct guess if I assume that you are developing an application from where users can log in and upload videos to some kind of service?
Assuming the answer to 3 is YES, then here is a suggested answer to your question:
Create an SQLite Database in your app with a table called "Videos" or such. Let that table have columns for video ID, name, length, date uploaded and any other information that can be useful in your app. Whenever the user uploads a video from your app, insert a new row in your SQlite table with information about that video.
This table should contain the information that you need to show in the TableView of your app. When the user clicks a video or if you need to do other things like showing a thumbnail, load the video from the iPhone using ID or name stored in the table.

Facebook Photo uploading into "foreign" album instead of "*appName* Photos"?

I am successfully uploading photos with my iPhone App and the corresponding Graph API calls, and it ends up properly in an (automatically created) album "appName Photos" on a new account w/o existing albums. Uploading to my own account, however, puts the photo to "Camera + Photos", the first of multiple albums existing for my account, instead of creating a new one for my app.
Anything I need to consider specifically to enforce creation of an app-related album? Do I need to go through an explicit album creation process first? I thought all the required information would be provided by the logon procedure, containing the appID (and seemingly does when using the "empty" account)?
EDIT:
I just had the albums programmatically listed, and actually an according album WAS created and is returned in the list of albums now, however it does not show up and contains no photos. So maybe it is rather a bug that the actual upload is taking place to the next album in the row (maybe some race condition on the FB side)?
Thx for insight, habitoti
By default, it should work that way (as described in the docs) but it appears to be a recent change to no longer enforce creation of an app-related album but to use a default album for all posted photos that aren't explicitly added to a specific album.
You'll want to use the procedure described here (look at the second chunk of code) to ensure that it creates an application-named album.

Path of the photo album from iphone device

In my project, i want to do something like this.
I just want to read the Path of the photo albums from the iPhone device,from where i want to get the photos. After getting the photos, i want to display the photos as views with swiping methodology, similar in the photo albums but in my project.
Is there is a way to achieve this?
Please advice me??
Unfortunately, you can not directly access the photo library from what I am aware of, but you can always use the image picker, which seems to have your required functionality.
https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html%23//apple_ref/doc/uid/TP40007070