No songs detected on iPad

…衆ロ難τιáo~ 提交于 2019-12-11 08:08:41

问题


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 :(


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/21559931/no-songs-detected-on-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!