in order to check if the user has provided all the permissions i need for my app, I do it so:
/*Solo hacemos la peticion si el checkbox estaba desmarcado. Nota: esta funcion asume que solo hay un checkbox en el dom*/
if($('input:checkbox').prop('checked')){
FB.login(function(response){
console.log(response.status);
if (response.status == 'connected') {
hi /* Entonces listo */
}else{
/* Entonces cancelamos el checkbox */
$('input:checkbox').removeAttr('checked');
}
}, { scope: 'publish_stream' });
}
This way:
-
if user did it allready: a popup is opened for less than a second
-
if user didnt yet: the permission dialog is shown
Question is: how can i prevent the dialog to be opened (maybe running it in the background) in the first case?
You cannot stop a popup when you use
FB.login.Either use a server side authentication or use
FB.getLoginStatusto prevent popup in first case.Refer Facebook docs
A snippet from the above reference link,
This is what you need.
Edit: (after OP’s comment)
May be facebook is caching old result.
From the same link I mentioned above,