LinkedIn javascript SDK Share Dialog - linkedin

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.

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:

Related

Flutter - Create sharable profile link

I am trying to create a Social media kind of networking Flutter app in which user can share his profile link. That link must redirect directly to user's profile if app is installed else redirect to link to download app. I am using Firebase as backend. Any resources or packages to work with?
You can use the package Share to enable the user to share their profile themselves. Its really easy to use.
If you would like to share a profile you will need to provide the navigational route to get to the profile screen, then provide the user's ID/data to get/view the desired data.
As far as getting a deep link to get the user to download the app if it is not installed, you can use firebase's dynamic link feature. You can customize what the link preview looks like and says. They have really good docs that you can follow.
You could use a Firebase dynamic link.
A dynamic link is basically a link pointing to possibly 3 resources:
Web URL
Android (Google Play) App ID
iOS (App Store) App ID
So once you configure it on Firebase (it's simple to configure), when the user access the link, Firebase will employ a decision tree to decide where to send the user.
In case the access is done on a mobile device, but if the app is not downloaded, it'll send the user to the store, and after returning from the store, will send the user to the correct path you've configured, following the link.
And on the app, you can implement the SDK to handle this link and when receiving this route request, redirect the user to the right profile they want to access.
I could go through the whole process, but I suggest you check the whole Firebase documentation:
https://firebase.google.com/docs/dynamic-links
In case you have a question on that where I can explain further, just let me know.

Does Linkedin API provide a way to get the Recent Updates from our company's profile

I am working on building our external web site for the company, and I want to show our company's LinkedIn profile's Recent Updates inside our web site. Currently when I access our company LinkedIn profile I can see those recent updates, which are available to public users as well (so users do not have to login to Linkedin to view those Recent Updates), as follows:
I read about the LinkedIn JavaScript API, and the capabilities it provides, and I already created a new LinkedIn Application and I set the required setting as mentioned on this link https://developer.linkedin.com/docs/getting-started-js-sdk but I got confused on how I need to use it and how the authentication will be managed.
I have the following questions:
Can anyone link me to some sample Code about using LinkedIn JavaScript SDK to get our company Recent Updates?
How the authentication for the LinkedIn JavaScript SDK work? I mean does the SDK allow getting our LinkedIn company profile's Recent Updates without require the user to be login to LinkedIn in advance? again our company Recent Updates can be viewed by any user who access our LinkedIn profile page (user does not have to be login to linked to view our profile and our Recent Updates). And since we are planning to show the Recent Updates inside our external web site, so we can not assume that any user who will view our web site is already login to LinkedIn to view those LinkedIn Recent Updates, or that the user has a LinkedIn account in the first place.
Edit
Based on the reply from #Craig Wayne. Now in my case I did not set any thing regarding the OAuth, since I only configure the required steps for the JavaScript as follow, so is this fine?:
Now I tried to use this link https://codepen.io/craigiswayne/pen/KGbqRq to test the Api call, where I entered the following info:-
Client ID: - "I entered out client id 14 digit"
REST URL:- "companies/<<our 8 digits id>>/updates?start=20&count=10&format=json"
but it keep trying to load the results, as follows:
Now final step inside our Sharepoint page I added the following code:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 14 digits code
onLoad: LinkedINJSAPI.onLoad
authorize: true
credentials_cookie: true
credentials_cookie_crc: true
</script>
<script>
var LinkedINJSAPI = {
onLoad: function(){
IN.User.authorize(LinkedINJSAPI.request, this );
},
request: function(){
var url = 'companies/<<>8 digits code>>/updates?start=20&count=10&format=json';
IN.API.Raw(url).
method('GET').
result(function(result){
console.log( JSON.stringify( result ) );
}).
error(function(error){
console.error( error.message );
});
}
}
</script>
where I got a popup from linked to enter a username and password,and after login, I got this error inside the browser console:
Member does not have permission to get company.
LinkedIn has an extensive API.
Does LinkedIn API provide a capability to get the company's Recent Updates?
Yes. LinkedIn API's provide the last 50 updates, including Job Postings, New Products, and Status Updates. Consult the API reference for company updates.
Can we securely integrate with the API using client side code (JavaScript)?
Yes. LinkedIn provides a JavaScript SDK. You should start by consulting their Getting Started with the JavaScript SDK guide, then look at their Company Pages guide.
Are API capabilities offered for free?
I can't find any documentation for pricing. It appears to be free with a rate limit throttle.
Can anyone link me to some tutorials & docs about integrating with LinkedIn apis using javascript code? and how we need to register with these APIs?
If you sign in to their developer site, you can create an application that will grant you the ability to make API calls.
Getting Started with the REST API guide
Get a company's updates
Create an Application to use the API's in their Developer site (requires free login)
Is there an RSS feed that can achieve these same goals?
There is an existing answer that outlines using RSS for displaying company updates.
Add your LinkedIN JS SDK to your site, should look something like this:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: <!-- YOUR CLIENT ID (API KEY) HERE -->
onLoad: LinkedINJSAPI.onLoad
authorize: true
credentials_cookie: true
credentials_cookie_crc: true
</script>
After which in your JavaScript add in the following:
var LinkedINJSAPI = {
onLoad: function(){
IN.User.authorize(LinkedINJSAPI.request, this );
},
request: function(){
var url = 'companies/1337/updates?start=20&count=10&format=json';
IN.API.Raw(url).
method('GET').
result(function(result){
console.log( JSON.stringify( result ) );
}).
error(function(error){
console.error( error.message );
});
}
}
You can see a working demo here...
https://codepen.io/craigiswayne/pen/KGbqRq
Member does not have permission to get company
can you confirm that the person that you login as has administrator permissions on the company page ?
if you login with the account on linkedin , do you see a manage option for the business page when you press on the "me" option next to the notifications.
because someone that wants to get company data has to be an administrator of the linkedin company page.

Is it possible to add share text as a query string to LinkedIn sharing URL and get it to work with LinkedIn mobile app?

The "text" query string works with desktop but on mobile the link opens the LinkedIn mobile application (if it's installed). Is there any way to get this working or is this something LinkedIn doesn't support?
Example:
https://www.linkedin.com/shareArticle?mini=true&url=http://developer.linkedin.com&title=LinkedIn%20Developer%20Network
&summary=My%20favorite%20developer%20program&source=LinkedIn&text=Test
Looking at the standard LinkedIn docs for LinkedIn.com: Making Your Website Shareable on LinkedIn, you get the impression that the only things you can control are: the title, the image, the description, and the URL, by means of og: tags.
But, looking further, it seems that if you register with the LinkedIn Share API, you can send a request to...
POST https://api.linkedin.com/v2/ugcPosts
With a content body like...
{
"author": "urn:li:person:8675309",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Hello World! This is my first Share on LinkedIn!"
},
}
If everything worked out successfully, you'll get a server code of 201 Created.
Source: LinkedIn.com: Consumer Solutions Platform > Integrations > Share on LinkedIn
So, you can prepopulate a full message in LinkedIn. This will, of course, require that users authenticate their LinkedIn account at your site, and that you register your app. This is a bit more than just using the simple shareable stuff, but it seems to work!

Why do I have access to the LinkedIn Full Profile without having to go through the "Apply with LinkedIn" API?

The LinkedIn Developer documentation states that full profile information is only accessible when calling the "Apply with LinkedIn" API.
But in practice, when doing a simple test using my own LinkedIn profile I manage to access the Full Profile fields via a "Sign in with LinkedIn" call (I use the JavaScript SDK btw).
That's all very nice because it means that I can access more fields than I expected via the "Sign in with LinkedIn" API, but isn't that a security bug?
PS: If you're a LinkedIn developer, there is a typo error on the Basic Profile fields page: field specialities should be spelled specialties.
you are accessing the data for your own profile that's y u can access all fields .. if you try to access any one else's full profile then you can't retrieve data from those profile . data retrieval of those profiles are limited to basic profile fields only
#JustinKominar's comment is the answer:
There is a blog post (https://developer.linkedin.com/blog/posts/2015/developer-program-changes) that explains that the recently announced changes to LinkedIn's API program will take effect on May 12th, 2015. You still have access because we are still in the transition period between the announcement and formal change. Presently, all previously documented capabilities are still available to you.

Send Facebook message from application

How can I send a message to the currently logged in user from inside a Flex application contained in a Facebook iFrame and using the official AS3 Library for Facebook please?
To date the Graph API is the easiest way to work with facebook.
http://code.google.com/p/fbas/
It's far from a complete implementation, but Graph is so simple it shouldn't take long to implement any features you need.
NOTE: When I've used it I ported the javascript portion of the example code on the project's main page to AS3 & ExternalInterface. It reduced external dependencies to zero (with the exception of swfobject)
Facebook does not allow you to send messages . Either way , you can post to the user's friends feed on behalf of the user , with a custom message and the the notification for the post in feed will be displayed.
Post your request to http://graph.facebook.com/PROFILE_ID/feed
Requires the publish_stream permission.
You can refer this link http://facebooksdk.blogspot.com/2011/04/facebook-album.html

Resources