I am trying to build a javascipt custom button that launches a google hangout and calls with person's phone number on the Lead record. Google has indicated this is what a page with a google hangouts button would look like:
https://developers.google.com/+/hangouts/button
Couldn't post the code here, but go to the Basic page with a phone number invite section.
So far I imagine the button would need look something like this, but if someone who is more familiar with javascript help that would be great:
{!REQUIRESCRIPT("https://apis.google.com/js/platform.js")}
<g:hangout render="createhangout"
invites="[{ id : '{!Lead.Phone}', invite_type : 'PHONE' }]">
</g:hangout>
Update:
Thank you. I am trying to pass the phone number parameter in too. This is what I have so far, but it just opens a blank hangout window. Any advice?
> var gHangout_buttonImplemented = false;
jQuery(function(){
if(!gHangout_buttonImplemented){
gHangout_buttonImplemented=true;
//assuming the name of the button is gHangout.
//Hide the actual button and show the hangout butotn.
jQuery("[value=gHangout]").hide().after('<div id="hangoutDiv"></div>');
gapi.hangout.render('hangoutDiv', { 'render': 'createhangout'});
gapi.hangout.invite('hangoutDiv', {'id': '8019010856', 'invite_type': 'PHONE'});
}
});