UIActivityViewController use items in specific actions

I have a UIActivityViewController and i want to make it have all the actions safari does and more. Currently i can only get mail, messages, twitter, facebook and a semi-working copy. I set the activity items array with a url. I then added a nsstring of that url and added that with the url, and everything worked good like copying worked better by copying the string and i paste it in more areas. But when having the string also, twitter and facebook added the urls into their text and include the link. How can i make it so they dont have the text, just the link? Another issue is how can i show the web view preview in the link on the twitter and facebook activities? it just shows a safari icon. And third question is how can i print the contents of the web page?

  • UIActivityViewController for Facebook not Showing Default Text
  • Determine which share extension was used
  • iOS 6 - UIActivityViewController items
  • Sharing image and text to Facebook Messenger with UIActivityViewController failing
  • How do I set recipients for UIActivityViewController in iOS 6?
  • I have REAL misunderstanding with MFMailComposeViewController in Swift (iOS8) in Simulator
  • 3 Solutions Collect From Internet About “UIActivityViewController use items in specific actions”

    To provide different items for different services, you subclass UIActivityItemProvider. It conforms to UIActivityItemSource protocol, so you implement method:

    - (id)activityViewController:(UIActivityViewController *)activityViewController
             itemForActivityType:(NSString *)activityType {
        // compare `activityType` and return what you want
    }
    

    I found this http://www.albertopasca.it/whiletrue/2012/10/objective-c-custom-uiactivityviewcontroller-icons-text/ which shows how to do different content for each service

    For twitter or facebook, you would want to setup UIActivity with correct type of twitter/facebook post (see Constants at the bottom here) and payload.