从iOS应用程序在LinkedIn上共享URL

从iOS应用程序在LinkedIn上共享URL,ios,objective-c,iphone,linkedin,linkedin-api,Ios,Objective C,Iphone,Linkedin,Linkedin Api,我正在开发一个iOS应用程序,当用户点击“共享”按钮时,我需要在linkedIn上共享URL。我的应用程序的URL应该被共享。如果安装了LinkedIn应用程序,则应通过应用程序共享,如果未安装应用程序,则用户应能够共享vis safari。以下是我的代码 if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"linkedin://shareArticle/mini=true&url=http://c

我正在开发一个iOS应用程序,当用户点击“共享”按钮时,我需要在linkedIn上共享URL。我的应用程序的URL应该被共享。如果安装了LinkedIn应用程序,则应通过应用程序共享,如果未安装应用程序,则用户应能够共享vis safari。以下是我的代码

if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"linkedin://shareArticle/mini=true&url=http://code.tutsplus.com/tutorials/ios-sdk-working-with-url-schemes--mobile-6629"]]) {

        // opening the app didn't work - let's open Safari
        if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.linkedin.com/shareArticle?mini=true&url=http://code.tutsplus.com/tutorials/ios-sdk-working-with-url-schemes--mobile-6629"]]) {

            // nothing works - perhaps we're not only
            NSLog(@"LinkedIn doesn't works. Punt.");
        }
    }
当应用程序未安装时,此功能可以正常工作。用户被重定向到safari并包含我的应用程序的URL。 但如果安装了应用程序,它会打开共享弹出窗口,但不包括我的URL。分享效果很好
我需要包括我要传递的共享的URL。

完整的参考指南在这里

如果您正在构建和安装iOS9应用程序,请查看此处:@LucaD感谢您的回复。我正在iOS 8.4中运行该应用程序。我可以在本机应用程序中打开linkenIn共享弹出窗口,但该弹出窗口没有我正在传递的任何URL。应用程序和共享弹出窗口正在打开,但我传递的URL未传递给共享弹出窗口-up@NeerajPathak你解决了吗?