URL Scheme for Linkedin

前端 未结 4 2034
一整个雨季
一整个雨季 2021-01-02 12:27

I\'m having an ios App. I\'m able to open the linked native app from my ios App using the custom url scheme \"linkedin://\". But how to post a link to the linkedin native ap

4条回答
  •  隐瞒了意图╮
    2021-01-02 12:55

    If you get LinkedIn profile via LinkedIn REST API, then you can find publicProfileUrl field in JSON:

    { 
      ...
      "publicProfileUrl": "https://www.linkedin.com/in/eugene-brusov"
      ...
    }
    

    Then this line of code:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.linkedin.com/in/eugene-brusov"]];

    redirects you to target profile opened in the native LinkedIn app if it's installed or to the profile opened in iOS default browser.

    Tested on iOS 10.0.2 and 11.0.1.

提交回复
热议问题