Search code examples
apicloudtitaniumappcelerator

Getting error "api.cloud.appcelerator.com" in Titanium


I'm newbie to Titanium. I had created an application to login to the API cloud. But I'm getting an error in the following code as "api.cloud.appcelerator.com".

var userLogin = function(){

Cloud.Users.login({
    login: txtUsername.value,
    password: txtPassword.value 
}, function(e){
    if(e.success){
        alert('Welcome');
    }   
    else{
        alert('Error: ' + e.message+ 'Code = ' + e.code);
    }
});

};

the login function is calling on the click event of the button btnLogin as follows

btnLogin.addEventListener('click',function(e){

       userLogin();
});

I couldn't find any solutions yet. Please help me. Thanks in advance!!


Solution

  • This error occurs while the application cannot send any HTTP requests and it cannot connect to the cloud. And hence the request will be unauthorized