Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn javascript SDK Share Dialog

How can I force LinkedIn to always show the share dialog, I am using LinkedIn JavaScript API. My current implementation is like this

IN.User.authorize(function(){
  IN.API.Raw("/people/~/shares?format=json")
  .method("POST")
  .body(JSON.stringify(payload))
  .result(function(response){
    deferred.resolve(response);
  })
  .error(function(error){
    deferred.reject(error);
  });
});

If user is logged in and already has authorized the app, text is shared on LinkedIn without showing the share dialog.

I want user to have a look at the content before actually posting in on LinkedIn.

like image 963
Zahid Riaz Avatar asked Oct 12 '25 04:10

Zahid Riaz


1 Answers

If you don't use the SDK for sharing plugin, then you can just use a raw URL and it should work fine:

https://www.linkedin.com/sharing/share-offsite/?url={url}

Source: Microsoft LinkedIn Share URL Documentation.

For example, this will bring up the prompt for me:

https://www.linkedin.com/sharing/share-offsite/?url=http://www.wikipedia.org/

Prompt works fine:

like image 192
HoldOffHunger Avatar answered Oct 15 '25 04:10

HoldOffHunger