Is it possible to link Linkedin text link with UIActivityViewController?
I would like to share link + text from Linkedin with UIActivityViewController, but my code is not working :( I see Facebook and Twitter, but not Linkedin
let url: NSURL = NSURL(string: "http://www.google.com")!
let text: String = "Test Linkedin"
let items: [AnyObject] = [url, text]
let activityViewController: UIActivityViewController = UIActivityViewController(activityItems: items, applicationActivities: nil)
activityViewController.setValue("Test", forKey: "subject")
self.presentViewController(activityViewController, animated: true, completion: nil)
If I only give the url, I see Linkedin in my parameters. What is the problem? I can see that Safari Sharing is working well.
+3
user3914418
source
to share
1 answer
Apple does not provide activity for LinkedIn. If you want to share text and link with UIActivityViewController, you need to create your own UIActivity. See the documentation here:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/index.html
You can also have a look at this SO post which will show you how to create your own (in Objective-C)
0
source to share