Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RagingGoat

macrumors 6502
Original poster
Jun 21, 2010
308
15
Can I open a URL in Safari using UIActivityViewController like I'm currently doing with an ActionSheet? I'm switching to UIActivityViewController for the Social Network sharing capabilities.
 
You cannot at least not with out subclassing your own UIActivityViewController. The only built in actions are listed below:

Code:
NSString *const UIActivityTypePostToFacebook;
NSString *const UIActivityTypePostToTwitter;
NSString *const UIActivityTypePostToWeibo;
NSString *const UIActivityTypeMessage;
NSString *const UIActivityTypeMail;
NSString *const UIActivityTypePrint;
NSString *const UIActivityTypeCopyToPasteboard;
NSString *const UIActivityTypeAssignToContact;
NSString *const UIActivityTypeSaveToCameraRoll;
 
I've got the sharing of URLs working with my UIActivityViewController but the URL doesn't show up in the box that comes up to share Twitter or Facebook. If I tap post it will post the URL fine. Any ideas how I can get it show in the post field before posting?
 

Attachments

  • IMG_1447.PNG
    IMG_1447.PNG
    291.9 KB · Views: 95
In your example the facebook post composer is showing you that you have an attachment with the paperclip you can tell is a web url because of the safari looking compass. If it were an image it would be a thumbnail. If you want to post the url as text it will need to be in the form of NSString and not an NSURL that you are sharing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.