在iOS应用中使用LinkedIn分享

时间:2015-03-11 05:39:25

标签: api swift linkedin url-scheme

我正在尝试使用swift在LinkedIn上分享链接。以下是我的代码:

var url = NSURL(string: "https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=78a08cwgh3mdr5&redirect_uri=GooglePlusShare://&state=987654321&scope=r_basicprofile")

UIApplication.sharedApplication().openURL(url!)

它移动到safari一个节目

enter image description here

我在重定向uri中添加了应用程序的URL方案。请让我知道我在哪里犯了错误,或者有没有其他方式在LinkedIn上分享内容。我不想使用第三方扩展程序。

提前致谢

1 个答案:

答案 0 :(得分:0)

网址字符串应以"linkedin://"开头,如以下帖子所示: Custom URL link for linked in app

var url = NSURL(string: "linkedin://#profile/78a08")

UIApplication.sharedApplication().openURL(url!)