Question

My app has been rejected by Apple :( The issue reported is

The application does not detect the songs on the iPad.

I already tried to have all the tests I can in order to understand the issue, but on MY ipad and on MY songs, everything works 100% fine.

In my code I'm handling the situation of an empty library in the following way:

MPMediaQuery *albums = [MPMediaQuery albumsQuery];
NSArray *albumCollections = [albums collections];
if ([albumCollections count] > 0) {
    // everything fine, let's start
}
else {
    // display an UIAlertView warning the user that the library is empty and stop
}

Now Apple just sent me a screenshot to display that the UIAlertView it's always showing up, even if they state they have songs on the iPad.

What can be the issue? Can maybe albumCollections be empty even if there are songs on the device? Any help is greatly appreciated, I put lot of effort in the app and seeing it rejected for a reason I'm not able to reproduce is so frustrating :(

Was it helpful?

Solution

What you learn from your code is that there are no MPMediaItemCollections (i.e. no albums). That is not the same as claiming that there are no songs.

OTHER TIPS

check this code

MPMediaQuery *everything = [[MPMediaQuery alloc] init];

NSLog(@"Logging items from a generic query...");

NSArray *itemsFromGenericQuery = [everything items];// get all media content

for (MPMediaItem *song in itemsFromGenericQuery) {

   NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];

   NSLog (@"%@", songTitle);

}

reference link --ipad library access programming

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top