javascript - Check if user posted (or cancelled) sharing to Facebook in Share Dialog using FB.ui -



javascript - Check if user posted (or cancelled) sharing to Facebook in Share Dialog using FB.ui -

i'm using share dialog , want occur after user posts his/her timeline. right i'm using:

function sharetofb(myname, mylink) { $('.overlay-bg').hide(); fb.ui({ method: 'share', href: mylink, name: myname }, function(response) { if (response && !response.error_code) { alert("something"); } else { alert("error"); } } ); }

but causes "something" show when user cancels posting. there way can find if user has posted message his/her timeline without requiring permissions. won't mind if requires me utilize different method of sharing (like feed dialog).

use feed dialog instead.

despite ui beingness ugly, successful sharing via feed dialog homecoming response object {post_id: "10206702999763274_10206703017843726"} regardless of user authenticating facebook app or not, while pressing cancel homecoming null , closing popup homecoming undefined.

you can test behaviour going normal facebook user profile settings , seek removing app allowed list.

this in contrast share dialog, which, if app has not been authenticated user, homecoming empty response object {} regardless of successful sharing or not.

furthermore, if utilize direct url redirect method instead of js sdk, when user press cancel on share page receive parameter error_code , error_message appended redirect target.

[from dec 2015] => utilize feed dialog or share dialog access post id in response. accomplish user must have logged app , granted publish_actions. https://developers.facebook.com/docs/sharing/reference/share-dialog#response

note: true time of writing (api v2.3). facebook notorious breaking api behaviour, should test first.

javascript facebook

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -