1

I´m trying to do a Ajax Request to a Server from my mobile App. When testing on my Pc with localhost I´m able to connect and get the data. But when testing this from my mobile phone I cant even get a connection. I could swear it worked some builds ago and then suddenly stopped working.

When fireing the ajax reqeust the server doesnt show any log entries.

Tried to set the default xhr header in my ajax to false.

my ajax

Ext.Ajax.request({
        url: myUrl,
        method: 'POST',
        username: 'someuser',
        password: 'somepw',
        withCredentials: true,

        //useDefaultXhrheader:false,


        params: {
            //localStorage.getItem('UUID'),
            appDeviceID: '4d55a4-4e97a3-aaf5e1-887afea5f0de-334aef', //example uuid
            controller: 'appLogin',
            username: username,
            passwort: password
        },
        success: function (response, eopts) {
            var result = Ext.decode(response.responseText);

             console.dir(result);



            if (result.success === true) {
                console.log("Login erfolgreich");

                //Login erfolgreich -> UserDaten Speichern
                localStorage.setItem("LoggedIN", true);
                localStorage.setItem('USER_DATA',result.userData);

                //LoginView zerstören
                meThis.getView().destroy();

                //weiter zur Main
                meThis.redirectToMain();

            } else {
                console.log("Login nicht erfolgreich");

                localStorage.setItem("LoggedIN", false);

                meThis.setTextToHiddenLaben('Eingabe Falsch!');

                //Eingaben aus dem Login Form löschen
                var form = Ext.getCmp('login');
                form.reset();
            }

        },
        failure: function (response, eopts) {
            localStorage.setItem("LoggedIN", false);
            console.log('Serverside failure with statuscode: ' + response.status);
            console.log(response);

        }

    });

-working with modern toolkit only

Anyone a idea what the problem is?

Greetings

Offset
  • 609
  • 1
  • 5
  • 22
  • my best guess is to test your application from other computer to make sure you have full access to all your server files. after that for example in chrome's developer tools turn on device mode to test your application for like it was opened in you mobile or tablet device. – LightNight Feb 22 '16 at 14:16
  • Looks I solved it. The problem was the https url. after switching to http i could receive a response via mobile devices. Looks like the server admin has to do some configuration on the server + adding a valid certificate. At this point i have a problem in receiving cookies. Maybe its because of the http because cookies are "secure". Any infos welcome – Offset Feb 23 '16 at 07:41

0 Answers0