-1

I want to share a URL on Facebook and Twitter using UIActivityViewController. The problem is the URL is very long. Can I give a hyperlink or shorten it somehow?

Azat
  • 6,745
  • 5
  • 31
  • 48
Rahul Patel
  • 1,822
  • 12
  • 21

1 Answers1

1

You can share URL itself the following way

NSURL *longURL = [NSURL URLWithString:@"http://..."];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[ longURL ] applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];
Azat
  • 6,745
  • 5
  • 31
  • 48