How to through the gracenote playlist ident (eg: 0_12) get the name of the song - playlist

I have a confused, I want to through the generation of playlist in the ident (eg: 0_11) to get the song name, what shoud I do and those functions can be used. thank you!

Collection Summaries in Gracenote Playlist do not store any metadata. The Collection Summary only stores the identifier for a piece of media that your application gives it. Playlists that are generated will only return these identifiers.
It is up to your application to use these identifiers to refer back to the media to do what you wish (in your case, to get the track name). Most media applications already have a media database of their own, so the identifier is normally a reference into the application's media store.
TL;DR;
You need to create a database that maps the Playlist identifiers to the song name.

Related

Is it possible to get the iTunes Store ID for an MPMediaItem?

Is there a way to get the iTunes Store ID for a song from an MPMediaItem?
I'm trying to pull the user's playlists, transfer those to another device, then play the songs using MPMusicPlayerController's setQueueWithStoreIDs. This would require mapping the MPMediaItems to content in the iTunes Store, which is the purpose of iTunes Match, which is included in an Apple Music subscription.
Theoretically, this should be possible for songs that were matched to iTunes content. However, I can't find a property or valueForKey on MPMediaItem or any other class in MPMediaPlayer framework that supports this. The persistentId set of properties are local DB keys and don't tie back to the iTunes content for the item. They don't seem to be the same across devices for the same user either.
This is now possible in iOS 10.3+ using the playbackStoreID instance property on MPMediaItem.
https://developer.apple.com/documentation/mediaplayer/mpmediaitem/2813404-playbackstoreid

Launching iTunes Store within App with Search

I'm creating an iOS radio station app, and I can't find a solution to what I thought was a simple problem. If my radio station plays an song/album people want to buy, how can I just launch the iTunes Store and have it open with a search results for that track or album?
I know I can use the Apple Search API to get a json of the search results and parse that for the best search results, and I know I can open the iTunes store with https://itunes.apple.com/ (if I try to append a search string to this, I get the metadata back) or with SKStoreProductViewController if I know the product ID.
But is there a way to simply open the iTunes Store to open with search results for a song or album (or both) without having to evaluate the search metadata and send them to one (perhaps wrong) product?
Thanks!
You can do this using URL Scheme's and a tool called iTunes Link Maker. Documentation can be found for iTunes on Apple's website here
The iTunes URL scheme is used to link to content on the iTunes Music
Store. The iTunes URL format is complicated to construct, so you
create it using an online tool called iTunes Link Maker. The tool
allows you to select a country destination and media type, and then
search by song, album, or artist. After you select the item you want
to link to, it generates the corresponding URL.
http://linkmaker.itunes.apple.com/

How To Distinguish One Music File From The Other

I am currently building a music player app. One of the functions of my app is "My Favorites". This is nothing different from other music player apps, for it allows user to mark down their favorite songs, and when they want to play only their favorite songs, they can play them directly from the "My Favorites" list.
My problem now is that in order for me to remember and be able to play that song next time, I think I have to remember the UNIQUE ID of that song. I am not sure if there is really a UNIQUE ID for every music file stored in the phone. I just thought of that because if there is, it would be a key for me to access that music file.
The solution I tried is appending the name of the music and the artist and use it as the key. Then, I will get the music list and run a loop through it, once I find the corresponding music file by comparing it with the key I will store it in an NSMutableDictionary. Then I will be able to play it later.
The problem of my solution is that what id two music files have exactly the same artist name and same title. That I won't be able to distinguish which is which.
I hope I made my self clear. To summarize:
Problem: Is there a way to get the UNIQUE ID of a music file. If there isn't are there any other ways to determine one music file from the other?
As what #Larme suggested. I could use MPMediaItemPropertyPersistentID for the unique ID of my music files, and that is what I've applied, and it is the right answer for me.
Thank you #Larme!

can i access a directory list on mobile devices using Trigger.io?

I want access to the file system to get a list of the photos on the device so as to be able to display them in my app.
I don't see a method in the API providing that information. Is there a way of getting at it?
We don't have an API method to list all the photos taken via your app, but you do have options for how to do that yourself.
Firstly, when doing forge.file.getImage, you can save the file objects for later use - in forge.prefs, for example, which does have a list keys method.
Or, if the photos are saved to the gallery, you could use the source: "gallery" argument to getImage, which would let the user browser through the available photos and select one.

Obtaining iTunes ID to an iPod player item

I have an app that interacts with both the iPod player, and the iTunes Store Web Service Search API. Is there a way to obtain the iTunes ID for a song that I retrieve from my user's iPod library (e.g. via MPMusicPlayerController, or MPMediaItem)?
The documentation says that the MPMediaItemPropertyPersistentID is a unique identifier that persists across app launch. This however, seems like it might be a unique local id.
The only solution I can think of is to retrieve the song title and artist from MPMediaItem, then query iTunes to obtain the iTunes ID. Is the iTunes ID stored anywhere locally within the iPod library?
Thanks - I am pretty new to the media framework.
The API documentation does not list a property for MPMediaItem that gives the iTunes Song ID, but it does give all of the information about a song such as the Artist and song name so, as you suggested, you could search the store for that criteria.

Resources