jQuery-Facebook-Photo-Selector
jQuery-Facebook-Photo-Selector copied to clipboard
Prompt to login when triggering gallery
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?
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.