Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an URL to Safari's reading list in iOS?

In my UIWebView I would like to add an option to add the current page to Safari's reading list. I know this feature exists since GMail offers it when long-pressing a link, yet I can't find any info on what URL scheme to use.

Possible duplicate: How to programmatically access Safari's reading list from iOS

like image 923
axelarge Avatar asked Oct 05 '22 12:10

axelarge


1 Answers

iOS 7 added an API to accomplish this:

#import <SafariServices/SafariServices.h>

SSReadingList * readList = [SSReadingList defaultReadingList];
NSError * error = [NSError new];

BOOL status =[readList addReadingListItemWithURL:[NSURL URLWithString:urlToAdd] title:titleToAdd previewText:previewText error:&error];

if(status)
{
        NSLog(@"Added URL");

}
else    NSLog(@"Error");
like image 189
Leon Lucardie Avatar answered Oct 10 '22 01:10

Leon Lucardie