androidlinkedin-apilinkedin-j

How to open user profile Linkedin with app in android


I'm trying to open Linkedin profile with an app in Android, with a URL or member id.
I try this:

Intent linkedinIntent = new Intent(Intent.ACTION_VIEW);
linkedinIntent.setClassName("com.linkedin.android", "com.linkedin.android.profile.ViewProfileActivity");
linkedinIntent.putExtra("memberId", <member id>);
startActivity(linkedinIntent);

but this code just opens the Linkedin app.
How can I open the specific profile?


Solution

  • According to posts on the LinkedIn Developer forums, this functionality is not exposed by their API.

    Sources:

    1. http://developer.linkedin.com/forum/android-intent
    2. http://developer.linkedin.com/forum/mobile-user-profile-url

    However, there is an undocumented method which seems to work. Naturally, it may have an oversight on their part to have left it open for use and making of use this naturally comes with the warning since it is undocumented, it may or may not change. If it does change, it may break the functionality of your app

    With that said, the suggestion from one of LinkedIn's employee here: https://developer.linkedin.com/comment/3614#comment-3614 has disclosed the above undocumented feature.

    http://www.linkedin.com/x/profile/{consumer-key}/{member-token}
    

    Good luck and hopefully, LinkedIn will make such a feature (simple and somehow, still ignored) available via their API.