Andre Brum Sampaio
Andre Brum Sampaio

Reputation: 39

Share via Ajax link ima my aplication stream publish

When my application creates a new post, it will automatically show up under the links "like" and comment, but does not appear to" share ". Would like to create an action for sharing with ajax, but do not know how. Does anyone know how to create this link ?

http://www.facebook.com/ajax/share_dialog.php?s=99&appid=&p[]=

how do I get information in my application to concatenate to build this link?

My Code:

$attachment = array(

'access_token'=> $ACCESS_TOKEN,
'name'=> $TITLE,
'message'=> '',
'description'=> $DESCRIPTION,
'caption'=>'',
'picture'=>'',
'link'=>  $LINK,
'actions'=> array( array(
                           'name' => 'SHARE', 
                           'link' => "http://www.facebook.com/ajax/share_dialog.php?appid=$APP_ID")
                   ));

See image: No link to share the post.

enter image description here

thanks!

Upvotes: 2

Views: 2797

Answers (3)

Waqas Ahmad
Waqas Ahmad

Reputation: 1

if you are attaching links then change the feed type me/links instead of me/feed. And this will show share in actions

Upvotes: 0

Shreeni
Shreeni

Reputation: 3307

The following notes answers your question.

  • The destination page of an FB share must contain the right title, img and open graph tags as desired by your "share" or "post". Facebook uses this to determine what to show in the post.
  • If your page is controlled by you, then of course, you can control this experience.
  • If your page is inside facebook (specially a tab application), then you can't control this since your destination would be a "https://www.facebook.com/page/?sk=app_xxx" link and that can't be controlled by you.

So, what we did is to create an intermediary page (say http://redirect.com/abcde) with the above properties and use that as the destination to the "share" links. The intermediary page then does nothing except to the forward the user to the right tab application. So, you manage to control the exact experience.

Upvotes: 2

Matthew Johnston
Matthew Johnston

Reputation: 4439

It's not possible to hack together a workaround for the AJAX Share popup, however you can very easily publish a post with an action link to sharer.php:

https://graph.facebook.com/me/feed?message=Testing&actions=[{"name":"Share","link":"https://www.facebook.com/sharer.php?u=http://example.com&t=Share Title"}]&method=post&access_token=TOKEN

This is a very simplified way to add an action link to a published story. You could also use one of the newer, non-deprecated Dialogs that can be linked to via hyperlink.

You can also add your voice to this bug report which is requesting the standard Share link be added in for app published stories.

Upvotes: 1

Related Questions