首页 > 解决方案 > How to fetch all subscribed Podcasts and not just downloaded ones, locally

问题描述

I'm building an import method from the native Apple Podcasts app into my own.

So I've been using a predicate to fetch MPMediaItems of type Podcast from the local device, however, this (As shown below) only shows downloaded episodes and not shows:

MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInteger:MPMediaTypePodcast] forProperty:MPMediaItemPropertyMediaType];

MPMediaQuery *query = [[MPMediaQuery alloc] init];
[query addFilterPredicate:predicate];

NSArray *items = [query items];

for (int i = 0; i<items.count;i++){
    MPMediaItem * item = items[0];
    NSLog(@"%@", [item podcastTitle]);
}

How do I fetch a users subscribed podcasts from their device using either a predicate or MusicKit?

标签: objective-cpodcastmpmediaqueryapple-musickit

解决方案


推荐阅读