Android: got Device Token in Emulator but device show "api.cloud.appcelerator.com"

You must Login before you can answer or comment on any questions.

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

— answered 12 months ago by Jacob Taylor
answer permalink
3 Comments
  • thanks jacob! I have just removed the SOAP code and forgot to remove it's else condition. I'll let you know after more testing. thanks

    — commented 11 months ago by Abdus Sattar

  • OOps Sorry! I have not connected to Wifi when I test my App. thanks Jacob for you kind help.

    — commented 11 months ago by Abdus Sattar

  • No problem, glad to help!

    — commented 11 months ago by Jacob Taylor

Your Answer

Think you can help? Login to answer this question!