简体   繁体   中英

iOS Swift LinkedIn App URL Scheme is not working

I want to open user linedIn profile(in linkedIn Native App) from my App.

I tried this but its just opening linekdin App but not profile page: URL Scheme for Linkedin

I have added URLSchemes as well

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>linkedin</string>
</array>

This is my code

if let linkedinUrl = URL(string: "linkedin://profile?id=parmarvhv"),
   UIApplication.shared.canOpenURL(linkedinUrl) {
   UIApplication.shared.open(linkedinUrl, options: [:], completionHandler: nil)
}

LinkedIn Web Url is this: https://www.linkedin.com/in/parmarvhv/

What is the correct way to open user profile?

This code works for swift 5 :

Opening a LinkedIn page:

linkedin://company/binance

Opening a LinkedIn profile:

linkedin://profile/binance

Well, it's not documented. so you can't rely on it.

But, using linkedin://in/{username} works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM