UIActivityViewController

Discussion in 'iOS Programming' started by RagingGoat, Jan 8, 2013.

  1. RagingGoat macrumors 6502

    Joined:
    Jun 21, 2010
    #1
    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.
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #2
    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;
    
     
  3. RagingGoat thread starter macrumors 6502

    Joined:
    Jun 21, 2010
  4. RagingGoat thread starter macrumors 6502

    Joined:
    Jun 21, 2010
    #4
    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?
     

    Attached Files:

  5. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #5
    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.
     
  6. RagingGoat thread starter macrumors 6502

    Joined:
    Jun 21, 2010
    #6
    Of course. I feel really lame for not noticing that.

    Thanks!
     
  7. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky

Share This Page