2

I am developing a iOS app in that I need to share URL on linkedIn When user taps share button my app's URL should be shared. If the LinkedIn app is installed sharing should be via app and if app is not installed user should be able to share vis safari.Below is my code

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.");
        }
    }

This is working perfectly fine when the app is not installed user is redirected to safari and my app's URL is included. But if the app is installed it opens the share pop-up but don't include my URL. Sharing is working fine I need to include the URL to the share that I am passing.

Neeraj Pathak
  • 311
  • 2
  • 18
  • If you're building and iOS9 app, take a look here: http://stackoverflow.com/questions/30987986/ios-9-not-opening-instagram-app-with-url-scheme – Luca D'Alberti Jan 04 '16 at 12:10
  • @LucaD thanks for the reply. I am running the app in iOS 8.4. I am able to open the linkenIn share pop-up in the native app but this pop-up not having any URL that I am passing . app and share pop-up is opening but the URL I am passing is not passed to the share pop-up – Neeraj Pathak Jan 04 '16 at 12:47
  • @NeerajPathak Did you solve it? – FelipeDev.- Mar 29 '16 at 14:31

1 Answers1

0

Complete refrence guide is here https://developer.linkedin.com/docs/share-on-linkedin

Neeraj Pathak
  • 311
  • 2
  • 18