Siebel Integration with Facebook, Twitter and LinkedIn using Siebel OpenUI

I have posted this video on Siebel groups and I got very good response from Siebel community. So, I have decided to explain steps of integrating this plugin and make it available for all. Lets call it..

Siebel Social Integration Plugin

[su_youtube url=”https://www.youtube.com/watch?v=ZzWnGZupueI” width=”540″ height=”360″]

In this post, I will explain all pre-requisites for this plugin and how it works.

Create App on Facebook Developer

go to https://developers.facebook.com/apps

Create New App on Facebook

Create New App on Facebook

 

Go to Settings and add App Domain & Site URL

Add ur Site URL

Add ur Site URL

Add ur App Domain

Add ur App Domain

 

Add Facebook Login Product in your App

Add Product in ur App

Add Product in ur App

 

How this plugin is working ??

1.) Initialize Facebook

On page load, we need to add Facebook JS file and initialize FB variable using valid App Key (which you will get from your App)

 

function fbInitialize(){
window.fbAsyncInit = function () {
FB.init({
appId: 'xxxxxxxxxxxxxxxxxxxx',
cookie: true, // enable cookies to allow the server to access 
// the session
xfbml: false, // parse social plugins on this page
version: 'v2.0' // use version 2.0
});
};

// Load the SDK asynchronously
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); 
}

 

2.) Authorize Facebook User

You will get Facebook Login popup to authorize as a valid user to access facebook data.

function fbAuth(){	//FB Auth			
	if( !FB.getAuthResponse() ){
		FB.login(function(response) {//calling FB login function to open login page
			if (response.authResponse) {
			 console.log('Welcome!  Fetching your information.... ');
			 //your code here...
			} else {
			 console.log('User cancelled login or did not fully authorize.');
			}
		});
	}else{
		//your code here...  
	}	
	if( typeof( FB ) === "object" ){
		//your code here...
	}	
//FB Auth

 

3.) Call Facebook API to search our contact

 

//Facebook API to find your details
FB.api( '/me?fields=id,name,about,age_range,bio,birthday,email,photos,picture,posts', 'get', function(response) {console.log(response);
	   console.log('Good to see you, ' + response.name + '.');
}); 

//Facebook API to search contacts	 
FB.api('/search?fields=id,name,about,age_range,bio,birthday,email,photos,picture,posts,link,gender',{ q:fname+lname,type: 'user'}, function(results) {
	console.log(results);
	//your code here..
});

 

How to download this plugin?

Click on below link to download, else share your mail id below in comment section.

Social Integration Plugin Files

Here is the Read me file from the plugin..

[su_document url=”http://www.askmesiebel.com/wp-content/uploads/2016/10/Read-me.txt” width=”500″ height=”460″]

In my next, I will explain how to embed this logic inside PM/PR files.

[su_divider style=”dotted”]

@skmeSiebel

6 comments for “Siebel Integration with Facebook, Twitter and LinkedIn using Siebel OpenUI

Leave a Reply

Your email address will not be published. Required fields are marked *