Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically access Safari's reading list from iOS

Tags:

ios

safari

Is it possible to access Safari's "Reading List" programmatically from iOS? I know it is possible to do it from a Mac as described here:

https://discussions.apple.com/thread/3238741?start=0&tstart=0

Thanks, gb

like image 878
gonzobrains Avatar asked Jul 17 '12 19:07

gonzobrains


2 Answers

iOS 7 added an API to add items to the reading list:

#import <SafariServices/SafariServices.h>
 
SSReadingList *readList = [SSReadingList defaultReadingList];
NSError *error = nil;

BOOL status = [readList addReadingListItemWithURL:[NSURL URLWithString:urlToAdd]
                                            title:titleToAdd
                                      previewText:previewText
                                            error:&error];
 
if (status) {
    NSLog(@"Added URL");
}
else {
    NSLog(@"Error: %@", [error localizedDescription]);
}

As Ashok pointed out in the comments, it's not possible to retrieve items from the reading list.

like image 171
Leon Lucardie Avatar answered Nov 09 '22 09:11

Leon Lucardie


It's not possible. There is no API for accessing the reading list. Moreover, it doesn't help if you find out the plist file's location, because of the sandbox environment it can't be accessed.

like image 2
Attila H Avatar answered Nov 09 '22 11:11

Attila H