I'm thinking of a way to implement share email function using gigya, and my website has very specific need for share bar(own template and css, animation, etc), so using buttonImages as below can not resolve my problem.
var params ={
userAction:ua,
shareButtons:'share,facebook,twitter,email', // list of providers
containerID: 'divButtons',
buttonImages:{buttonLeftImgUp:'Button_Left.png',buttonCenterBGImgUp:'Button_Middle.png',buttonRightImgUp:'Button_Right.png'}
};
I've successfully used another supported API, gigya.socialize.postBookmark(params), to implement this.
var params =
{
url: "http://www.gigya.com/",
provider:'tumblr',
facebookDialogType: 'share',
title: "Gigya"
};
gigya.socialize.postBookmark(params);
Unfortunately, this function does not support email as a provider, which means I can not add email into my own share bar. Does anyone know how to implement email share, while using my own template(not using customized image)?
Thanks a lot!
I am one of the engineers at Gigya. So that you can better understand what is happening under the hood, clicking on the email share button from the share bar UI ultimately boils down to a call that looks like this:
document.location.href = "mailto:?to=&subject=" + "Your email subject" + "&body=" + "The body of the email";
So really you can just write your own event handler to call a document.location.href like mentioned above with your own subject and body. Alternatively, you can just set the href of an tag to something equivalent.
Hope that helps,
-CodeMonkeyG
Related
I am adding share to slack functionality in my web app.
But I cannot find any solution by which I can show my app users to select a user/channel or team in slack to share the content with.
I have added Sharing on Teams also. In that I am able to select the users or search the particular user. Please refer the below link to see how it is looking in teams.
https://learn.microsoft.com/de-de/power-bi/collaborate-share/media/service-share-report-teams/service-teams-share-to-teams-dialog.png
I want to know, is there any way by which we can implement the sharing to particular user or channel etc on slack same as it is there in teams.
Thanks.
Once the Web app shares content, it's very much up to the receiving app to decide what it makes of the incoming data.
try {
await navigator.share({
title: 'Title',
text: 'Text',
url: 'https://example.com/',
});
console.log('Successful share'))
} catch (err) {
console.log('Error sharing', err));
}
Possible values are:
url: A string representing a URL to be shared.
text: A string representing text to be shared.
title: A string representing a title to be shared. May be ignored by the target.
See the bold part. Try populating text and title differently and see if it makes any difference.
The send dialog is a useful piece of functionality.
Sadly it is not available on mobile devices
I call the api in the following way;
app.sendMessage = function(){
FB.ui({
app_id: app.facebook_app_id,
method: "send",
link: "http://google.com"
});
};
Right now the outcome on a mobile device is a nasty error page.
Is there a way to detect in javascript whether or not the send dialog is available?
I'd suggest something like;
function sendDialogAvailable(){
return FB.supports("senddialog");
}
I could then change my app's functionality according to this property, but right now I fear I'll have to resort to browser sniffing.
I wanto to create on my facebook page (facebook.com/genericco) a custom poll, in it I wanna create funny polls people can vote on (mainly yes or no answers) and I'd like to post on the voter's wall the action (john doe voted yes on Genericco's poll: Do you think chicken-fish should stop smoking for health issues?).
So I could not do that just using graph API and reading my own questions...so I decided to use the open graph! I created an action called vote with the custom property answer as a boolean...
I've also created the object poll with image,question, title, description and the custom property question...
I've also populated with custom data in the aggregations part.
Then i used Putty program to run the code and be able to submit my custom action for approval...
My question now is...How do I use it? How do I put this together to achieve the objectives I've proposed on the top of this question?
can anyone shed a light?
So...I managed to build the customized poll app with Open Graph in facebook. its going well...but its not 100% yet. let me tell you guys why:
1 - So I managed to understand how to creat an action, I called it "Vote", it is connected with the Object type "Poll" I created; The action "Vote" has 2 custom properties: "Answer" wich is a String and "Name" wich is also a String;
2 - Then I created the object "Poll" and I filled it with sample data and stuff and also I created the custom property "Question";
3 - Then I created the aggregation "Enquete Ociosidade" (roughly translating would mean sloth poll) and the data is displays is the action "vote" and in the Caption I used something like this {poll.question}{name} thinks {answer};
Then to make it work I had to send a sample of the action to facebook somehow, I had no idea how to do this so I used Putty and simply pasted the code facebook provides for that; It worked;
Then comes the hard part, how would my front-end app send those info to facebook so I could register the action? Well I'm glad you asked!
I tryed till it worked...YOUR APP MUST HAVE PUBLISHING_ACTIONS PERMISSION THIS IS VERY IMPORTANT!
so...this is the code I got working:
FB.api('/me', function(response) {
//alert(response.name);
FB.api('/me/genericco:votar_poll&enquete=http://www.limonadaweb.com.br/genericco/poll_data.php&resposta='+resposta+'&nome='+response.name+'&access_token='+_token+'' ,'post', function(resp) {
if (!resp || resp.error) {
alert('Error occured '+resp.error.message);
//mostrar caixa de diálogo que algum erro ocorreu;
} else {
alert('Post was successful! Action ID: ' + resp.id);
//fazer algo legal para demonstrar que deu certo o voto;
}
})
});
what I did was...first I make a FB.api call to get the users name, in the callback I make a FB.api call to register the action VERY IMPORTANT TO PASS THE ACCESS_TOKEN TOO...and must be POST.... and that is all there is to it! very cool right? And all that code is inside a function my app calls whenever the user votes and sends a boolean value that I use as the answer to know if the user voted 'yes' or 'no'.
That is all very good and is working fine! Just fine....
My problem now is that now when the action is published in my timeline and newsfeed and stuff it sends the user to this link below...it has absolutely nothing visual in it...it is the poll's data...a bunch of metatags...
i'd like to know if it is possible to send the user to another link when he/she clicks the link of my feed...
http://www.limonadaweb.com.br/genericco/poll_data.php?fb_action_ids=10150744684398313&fb_action_types=genericco%3Avotar_poll&fb_source=other_multiline
So I have an iFrame app on a fan page, which includes the comments plugin. Is there a way I/any admin can receive a notification or email every time someone adds a comment?
You can subscribe to comment.create event and send the notification to admin in any way you prefer, once comment is created. Facebook itself doesn't provide such functionality.
This may looks like this (I assume Facebook JavaScript SDK is already loaded on page before doing this, read about it in documentation on Loading, anyway if you're using Social Comments Plugin it should be loaded already):
<script type="text/javascript">
FB.subscribe('comment.create', function(response){
// Here you need to do a call to some service/script/application
// to notify your administrator about new comment.
// I'll use jQuery ajax to call server-side script to illustrate the flow
$.post('//hostnamne/path/to/script', {
"action": "comment created",
"url_of_page_comment_leaved_on": response.href,
"id_of_comment_object": response.commentID
});
});
</script>
In your script located at http(s?)://hostnamne/path/to/script you can send a notification to admin, how to do it may vary on way you want it for example if you want to send an email you can use something like this php sample (aging this is just a flow sample, not real code you should use):
<?
$admin_email = 'root#localhost';
$commentID = $_REQUEST['id_of_comment_object'];
$page_href = $_REQUEST['url_of_page_comment_leaved_on'];
$message = "comment #{$commentID} was leaved on page {$page_href}";
mail($admin_email, "You have a new comment", $message);
?>
If you need to track the deletion of comments too you can use comment.remove event with similar flow...
For some time now I try to figure out how these guys were able to add "Sign online here" button which is "install App" button on their fan-page tab:
http://www.facebook.com/GuinnessIreland?v=app_165491161181
I've read around the web and couldn't come up with any solid solution. The FBML and FBJS documentation left me with nothing.
So please, if anyone can help me with this.
NOTE: To make multiple tests on the Ajax request that are sent, do not accept the App install. It behaves differently after that.
I had some problems with finding out about it as well. There is no info about this kind of behavior in wiki or anywhere. I got it working after trying some possible solutions and the simplest one is to make user interact with content embedded in fan page tab such as click on something etc. Then you need to post an ajax request with requirelogin parameter to pop up to come out. The simple example would be:
user_ajax = function() {
var ajax = new Ajax();
ajax.responseType = Ajax.RAW;
ajax.requireLogin = true;
ajax.ondone = function(data) {
new Dialog(Dialog.DIALOG_POP).showMessage('Status', data, button_confirm = 'Okay');
}
var url = "http://yourappurl.com/request_handler"
ajax.post(url);
}
And the trigger for it:
Interaction
Then if user is known to be using your application (fan page tab) you can prompt him for additional permission like publish stream or email communication by calling:
Facebook.showPermissionDialog('publish_stream,email');
Hope this solves the problem.