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.