How to connect Likedin with telephone connection

I want to connect Likedin to my application using Phonegap. I have a plugin search and OAuth procedure, no update. Regarding this. Does anyone know how to log in and get Likedin information using the Phonegap app.

+4
source share
2 answers

The linkdin plugin is currently unavailable for telephone communications, but you can manually implement this using the Inappbrowser plugin.

I used telephony angularjs as just an awesome javascript framework. Below is the code.

$scope.linkdin = function (title,description,image,index) { //window.plugins.socialsharing.share('Message only'); $scope.linkdinUrl = "http://m3.licdn.com/media/p/3/000/124/1a6/089a29a.png"; $scope.linkdinTilte = title; $scope.linkidnSummary = description; $scope.linkidnImage = "http://122.182.14.107:8080/GESmartCatalog/feature/image/"+$scope.fm_data[index].id+".png"; //alert($scope.linkidnImage) if(localStorage.getItem("linkedinWindowExpiry") == '0') { localStorage.setItem("linkedinWindowValue", "0") } if(localStorage.getItem("linkedinWindowValue") == '0' && localStorage.getItem("linkedinWindowExpiry") == '0') { localStorage.setItem("linkedinWindowValue", "1"); $scope.linkedinWindowText = 'location=no'; } else { // alert("sfgfsg"); // alert(localStorage.getItem("linkedinWindowExpiry")); $scope.linkedinWindowText = 'location=no'; } $rootScope.shareXmlLinkedin = "<?xml version='1.0' encoding='UTF-8' ?>"+ "<share>"+ "<comment></comment>"+ "<content>"+ "<title>"+$scope.linkdinTilte+"</title>"+ "<description>"+$scope.linkidnSummary+"</description>"+ "<submitted-url>"+$scope.linkdinUrl+"</submitted-url>"+ "<submitted-image-url>"+$scope.linkidnImage+"</submitted-image-url>"+ "</content>"+ "<visibility>"+ "<code>anyone</code>"+ "</visibility>" + "</share>"; var ref = window.open('https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=gw80y7867ukx&scope=rw_nus w_messages r_fullprofile&state=zwdkLai5urm0AscP&redirect_uri=http://www.softwebcms.com','_blank',$scope.linkedinWindowText); ref.addEventListener('loadstart', function(e){ if(e.url.indexOf('?code=') >=0 ){ if(e.url.match(/=[^]+&/)){ var code = e.url.match(/=[^]+&/)[0].substring(1).replace('&',''); // alert(code) window.sessionStorage.setItem('code', code); ref.close(); $.ajax({ url: 'https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code='+code+'&redirect_uri=http://www.softwebcms.com&client_id=gw80y7867ukx&client_secret=zwdkLai5urm0AscP', success: function(a){ //alert(JSON.stringify(a)); //alert(a.access_token); localStorage.setItem("linkedinWindowExpiry", a.expires_in); //alert($rootScope.shareXmlLinkedin); $.ajax({ url : 'https://api.linkedin.com/v1/people/~/shares?oauth2_access_token='+a.access_token, type: 'POST', method : 'POST', headers : { 'Content-Type' : 'application/xml' }, data: $rootScope.shareXmlLinkedin, success: function(a){ $modal.open({ template: "<div class='modal-body'><div style='width:100%; text-align:center; '><h3 style='text-align:center;'>Added to Linkedin</h3></div>", windowClass: "main_popup_width dialog", controller: function ($scope, $rootScope, $modalInstance) { setTimeout(function(){$rootScope.wtbfavactive="123";$modalInstance.dismiss('cancel')},3000); }, }); }, error: function(a){ console.log(JSON.stringify(a)) //alert(JSON.stringify(a)) $modal.open({ template: "<div class='modal-body'><div style='width:100%; text-align:center; '><h3 style='text-align:center;'>Already posted to Linkedin</h3></div>", windowClass: "main_popup_width dialog", controller: function ($scope, $rootScope, $modalInstance) { setTimeout(function(){$rootScope.wtbfavactive="123";$modalInstance.dismiss('cancel')},3000); }, }); } }) }, error: function(a){ //alert(JSON.stringify(a)) console.log(JSON.stringify(a)); } }) } } }); }; 

Hope this helps ... Thanks

+3
source

The plugin is currently unavailable for telephone calls. but you can use the Javascript API to connect Linkedin accounts. follow this link Linkedin Javascript API & amp; Enter the tutorial. You can call this API using the inappbrowser plugin. you can manage it with javascript and session management. Hope this helps.

+1
source

Source: https://habr.com/ru/post/1204911/


All Articles