9

Is there a service to be able to add a URL to the iOS Safari's Reading List from in a app.

I would have a url to add and a UIWebView,but I have researched and I can't find anything.

Here is my working UIActivityViewController.

 -(IBAction)actionButton:(id)sender;{
    NSLog(@"shareButton pressed");
    NSURL *URL = [NSURL URLWithString:self.feedItem[@"url"]];//this is your text string

    NSArray *activityItems = @[URL];
    ARChromeActivity *chromeActivity = [[ARChromeActivity alloc] init];

    TUSafariActivity *TUSafari = [[TUSafariActivity alloc] init];
    MLCruxActivity *cruxActivity = [[MLCruxActivity alloc] init];

    NSArray *applicationActivities = [NSArray arrayWithObjects:TUSafari,chromeActivity,cruxActivity, nil];
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities: applicationActivities];
    activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];

    activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact];
    [self presentViewController:activityVC animated:TRUE completion:nil];
   }
thvanarkel
  • 1,601
  • 1
  • 12
  • 19
Steve
  • 205
  • 3
  • 14
  • Trying to figure out how to do this as well, no luck yet... – ToddH Mar 20 '13 at 18:02
  • it seems as though it should be simple to implement, as when you hold down a link, it asks you if you want to "Add to Reading List" And it is in Safari. But I can't find anything. – Steve Mar 20 '13 at 19:37
  • I've updated my answer with a new sample available on iOS 7 – Leon Lucardie Sep 19 '13 at 07:53

1 Answers1

2

UPDATE: 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");

Currently (iOS SDK 6.1) there is no way to add a item to the Reading List from a third party app.

There are some alternatives like Readability you could use.

Leon Lucardie
  • 9,541
  • 4
  • 50
  • 70