Hi All! I am going through the ACS ( Appcelerator Cloud Service ) and got the device token in android Emulator but when I install that build in HTC I got this Error: "api.cloud.appcelerator.com". can anybody help me out, why it is happening so? here is my code.
Cloud = require('ti.cloud'); Cloud.debug = true; Cloud.Users.login({ login : 'abs', password : '123456' }, function(e) { if(e.success) { var user = e.users[0]; var CloudPush = require('ti.cloudpush'); CloudPush.debug = true; CloudPush.enabled = true; CloudPush.showTrayNotificationsWhenFocused = true; CloudPush.focusAppOnPush = false; Ti.App.fireEvent('show_indicator'); Cloud.PushNotifications.notify({ channel : 'alert', payload : 'Welcome to push notifications' }, function(e) { if(e.success) { // alert('Notify Success'); CloudPush.retrieveDeviceToken({ success : function deviceTokenSuccess(e) { deviceToken = e.deviceToken alert('Device Token = ' + deviceToken); } else { Ti.API.info('Oops, could not determine result of SOAP call.'); alert('Oops, could not determine result of SOAP call.'); } }); //================================================= Ti.API.info('Device Token = ' + deviceToken); }, error : function deviceTokenError(e) { alert('Failed to register for push! ' + e.error); } }); Ti.App.fireEvent('hide_indicator'); } else { alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); Ti.App.fireEvent('hide_indicator'); } }); } else { alert("Error : " + e.message); } });
1 Answer
Accepted Answer
That's not an error. The way you have it coded, it's just something that doesn't fit your condition. So, it's not necessarily a problem, just something you have to handle in your condition
Your Answer
Think you can help? Login to answer this question!