jQuery-Facebook-Photo-Selector icon indicating copy to clipboard operation
jQuery-Facebook-Photo-Selector copied to clipboard

Prompt to login when triggering gallery

Open noctivityinc opened this issue 10 years ago • 1 comments

This is FANTASTIC but I would like to prompt them to login if they are not logged in when they click the button, this way they dont have to click TWO buttons to get to their pics.

Anyway to do this?

noctivityinc avatar Mar 10 '15 16:03 noctivityinc

Hello @noctivityinc,

If you haven't solve this wish, you can do this in this way:

  • let's assume that we use example.js.

In click events you can compress $("#btnLogin"), $("#btnLogout") and $(".photoSelect") by one click event:

$("#connect-and-choose-photo").click(function (e) {
    e.preventDefault();
    FB.login(function (response) {
        if (response.authResponse) {
            fbphotoSelect();
        } else {
            // console.log( "You didn't allow a facebook connection." );
        }
    }, {scope:'user_photos'});
});

Hope this works for you 😄 It works perfectly for me.

vladutilie avatar May 08 '18 09:05 vladutilie