I have some 3 methods.
login();
isLogin();
reply();
function isLogin(){
FB.getLoginStatus(function(response) {
if (response.session) {
// logged in and connected user, someone you know
} else {
// no user session available, someone you dont know
}
});
}
function login (){
FB.login(function(response) {
if (response.session) {
// user successfully logged in
} else {
// user cancelled login
}
});
}
function reply(){
var body = 'Reading Connect JS documentation';
FB.api('/me/feed', 'post', { body: body }, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Post ID: ' + response);
}
});
}
I need, when a user will want to reply a comment then reply method will execute. before executing reply method it should test if user is login, if user is not login then execute login method and call reply method again. How can I achieve this task
Thanks in advance