So the problem is that the specified message is not in the facebook modal sharing window, it's empty doesn't have any text.
import {SocialSharing} from 'ionic-native';
...
shareFb(message?: string){
SocialSharing.shareViaFacebook(message,null,null).then(()=>{
//Success
},
()=>{
//cancel
});
}
<ion-icon name="logo-facebook"
class="share-facebook" (click)="shareFb(message.description)">
</ion-icon> <ion-icon ios="logo-twitter" md="logo-twitter"></ion-icon>
I have also struggled with this finally to find out - Sharing a message on Facebook is not possible (as of today).
It is mentioned in the SocialSharing plugin documentation at this part.
This is an issue with the facebook API. Here they have mentioned:
This issue is going to be closed by design because our API does not support pre-filling the message for users as seen in our Policy Documentation here
Basically, to sum up, it is not in there policy to allow this. Hope this helps.
Related
I can't see any solutions out there that allow this specific request without a lot of scripting or meta tags so I'm hoping there's a simple way to do this.
I'm looking for a custom share links for all four social networks. Let me give a concrete example.
If someone clicks on a twitter icon link on my site, they're clicking the following:
<a href="https://twitter.com/home?status="Welcome to my site and tell all your friends! #sitename #mysiterules http://bit.ly/site">
<img src="twitter.png">
</a>
it will go to Twitter's site and produce the following:
This allows someone to very quickly promote my site with a custom message that they can change if they like but there's no effort involved outside of clicking the icon link.
This is exactly what I want to do with the other three social networks, with a custom message and links. They can also pull the default logo of my site which twitter can't do.
How can I accomplish this?
I recommend you use the proper social sharing buttons like we implemented in on our live campaign page, but here is some code I stole from a mockup of the campaign page.
<div class="leader-half kids0514-share">Share this on:
<img src="images/en/share_mail.jpg" alt="email">
<img src="images/en/share_fb.jpg" alt="facebook">
<img src="images/en/share_tweet.jpg" alt="twitter">
<img src="images/en/share_pin.png" alt="pinterest">
<img src="images/en/share_plusone.jpg" alt="google plus">
</div>
Not all social sharing buttons are created equal, some have more functionality and even old versions you can still use. Pinterest is pretty minimal. I recommend using the official buttons and full structured meta data, not doing it the way this snippet from the mockup does.
On Facebook you are not allowed to share a prefilled message according to Platform Policy 2.3: "Ensure that all content in the user message parameter is entered by the user. Don’t pre-fill. This includes posts, messages, comments, and captions."
If you want people to share on Facebook I would suggest using the Share button: https://developers.facebook.com/docs/plugins/share-button/
I asked this on the Facebook Developers Forum with no responses.. How do I send notifications to users so they show up in the Notifications globe icon tab on the top left of a user's Facebook page? Some applications I use have their notifications show up there, but I don't see how that mechanism works in Facebook's API docs. Neither are there any permissions which seem to be required to send users notifications.
I know this is an old post - but someone might stumble on it as I did, and find it useful:
The notifications area in FB is updated by sending Requests which can be sent by using FB dialogs. The JS SDK provides the FB.ui() method to show dialogs for posting to stream, or sending a request.
More Info on FB:
http://developers.facebook.com/docs/reference/dialogs/requests/
http://developers.facebook.com/docs/reference/javascript/FB.ui/
Apparently facebook activate again the possibility to send notifications :
https://developers.facebook.com/docs/app_notifications/#ux
POST /{recipient_userid}/notifications?access_token= … &template= … &href= …
You need to post it to -
https://graph.facebook.com/
for example -
https://graph.facebook.com/{recipient_userid}/notifications? access_token= ... href= ... & template= ...
Update : Please check oneamongu's answer below. In my old answer I was referring to the custom notifications. oneamongu defined the requests structure very well below.
Old answer : Facebook Notifications were outdated by facebook about 1 year ago. Instead, you can post on a user's wall if you wanna inform him.
because when I run the query: {recipient_userid}/notifications? access_token= ... href= ... & template= ...
it's work only in facebook WEB?
I see the notification on the web facebook, but do not see it on facebook Mobile?
I have a Drupal 6 website where I've implemented Facebook Connect with the JavaScript SDK and it's been working fine for some months.
The site used the old Facebook Share button (pointing to sharer.php) but that didn't work with the new Facebook Connect API so I replaced it with fb:share-button.
My problem is that the Facebook share button doesn't work for users logged in via Facebook Connect. The lightbox for Facebook Share appears empty with just the loading bars. If the user is logged in to the site as a non Facebook Connect user then Facebook share works normally.
I've searched for similar problems and found an unanswered post at Facebook developer forum that looks like a similar problem.
This site also uses Facebook Like buttons but those, as far as I know, don't allow including an image from the liked image like share does. The owner of the site needs Facebook Share and has no plans of removing it to work just with Facebook like.
Any suggestions?
Thanks.
I got this code working for sharing
function share(){
var share = {
method: 'stream.share',
u: document.getElementById('txtShare').value
};
FB.ui(share, function(response) { console.log(response); });
}
I'm sharing a link on a user's feed - everything seems to be valid, but there's no Share link (Share button)... What is it that I'm doing wrong?
try {
$su = $facebook->api(
"/{$uid}/feed",
"post",
array(
"access_token"=> $access_token,
"message"=> "Message",
"link" => "http://url",
"picture"=> "http://url"
);
} catch (FacebookApiException $e) {
print_r($e);
}
Thanks in advance,
Doori Bar
very strange. I have the same problem. I have developed a Facebook App and I used a function to post on the user wall. But on the user Wall there is no "Share" link. It's only possible to like or comment it.
If I use this other technique, a dialog showing to post (on wall) OR to "send as a message instead" is displayed. (I was looking for this feature as well).
And the good thing is that the resulting post to the wall can be liked, commented AND Shared.
This is the javascript code that can help you to obtain this functionality:
<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;;url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>
Taken from http://askville.amazon.com/add-Share-Facebook-button-webpage/AnswerViewer.do?requestId=1539369
Hope this helps. It helped me at least ;)
You can create your own "Share" link using Actions described in the graph API here:
http://developers.facebook.com/docs/reference/api/post/
for example as json: {"name":"Share", "link":"http:\/\/www.facebook.com\/share.php?u=http%3A%2F%2Fvisibli.com"}
Note: the url param u must be url encoded.
I'm fairly confident this is a bug. To encourage Facebook to fix this issue, please "vote" for this bug by adding your app as a "repro" at the following link:
http://developers.facebook.com/bugs/154484061346461?browse=search_4f903d2ea60569f93022163
UPDATE:
Facebook marked the previous bug report as "Fixed" but it is NOT fixed. Please vote for the new bug:
http://developers.facebook.com/bugs/252491528185120
Update: Read the comments to the item marked as the answer below for the full answer.
I am implementing a Like button from Facebook per this document: http://developers.facebook.com/docs/reference/plugins/like
I am using the XFBML version so that users can add comments when they click on the Like button. I have imported the Facebook JavaScript SDK an am using a valid App ID. The button appears and I am able to "Like" the page, but I am never prompted for comments.
Is anybody else running into these issues? Anybody know of a fix?
Before I had inserted the correct appId in the FB.init() call to initialize the Facebook javascript SDK, the button appeared, I was able to "Like" the page like you, but saw no comment box either.
When I inserted the appId, but hosted the page locally, I got an error message saying that the page could not be reached (from Facebook's servers).
Finally, hosting the page on a public server made the buttons behave as expected: with comment box for the XFBML version, and without comment box for the Iframe.
Hope that helps...
add this style and the comment box will be hidden after you click like.
.fb_edge_widget_with_comment span.fb_edge_comment_widget iframe.fb_ltr {
display: none !important;
}
retailevovled is right. I've just found this tutorial which is a bit more detailed (German, but you can use Google Translate): http://www.be24.at/blog/entry/639312
Create an app for this specific implementation, then it will work:
http://developers.facebook.com/setup/
(I too first used an 'old' app-id with the same problems you described.)