Hi Guys,
I have 3 javascript methods.
isLogin();
login();
reply();
when I'll execute the reply method then first of all it should check that user is Login or not. If user is login then execute the reply method. If user is not login then execute it first and then execute reply method.
These are all Facebook Javascript SDK methods which are asynchronous. Therefore they don't return a value.
if for instance these are not async methods then these can return value, on which I can take decesion like this.
function isLogin(){
if(user.islogin()){
return true
}
else{
return false;
}
function login(){
if(user.hasLogin()){
return true;
}
else{
return false;
}
function reply(){
if(!isLogin(){ //User is not login
if(login()){ //Login User
//user has login. now reply
sendText(); //any statement which will reply
}
}
}
Please help
Thanks