0

i have designed app using ionic and angularjs. Earlier the app was working fine but now i have changed the api ....the app working on browser but not on device...its functionalities not working on device.. before changed the api(app working on device):

var CONSTANTS = "http://ip_address/api/";
var api =  CONSTANTS+'api.php?method=register' + '&user_registration=';

$http.post(api, {username : username,email : useremail,pwd : userpassword}).success(function(response) {   

    if( response[0].status == 1){               

        $cordovaToast.showShortBottom('Successfully Registered').then(function(success) {
            // success
        }, function (error) {
            // error
        });  

        document.getElementById('user_email').innerHTML = "";
        document.getElementById('user_email').innerHTML = "";
        document.getElementById('user_email').innerHTML = "";
        $state.go('auth.login');

    }else if( response[0].status == 0){

        $cordovaToast.showLongBottom('Existing User or Invalid Data').then(function(success) {
            // success
        }, function (error) {
            // error
        });  

    }else {
        //console.log('Error');
    }

}, function(err) {
    // console.log(err);
});

after changing the api in the code(app not working on device):

var CONSTANTS = "https://www.test.com/api/";
var api =  CONSTANTS+'api.php?method=register' + '&user_registration=';

$http.post(...)... // Same as above 
JanP
  • 1,579
  • 2
  • 16
  • 27
Priyanka
  • 35
  • 1
  • 6
  • Try investigating if request is not failing. There is some remote debugging as far as I remember for Ionic on devices. – zmii Jan 05 '17 at 09:40
  • https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools – zmii Jan 05 '17 at 09:41
  • how to use https in ionic? – Priyanka Jan 05 '17 at 10:32
  • http://stackoverflow.com/questions/31937038/http-requests-failing-on-ionic-after-ionic-build-android – zmii Jan 05 '17 at 12:38
  • this might help – zmii Jan 05 '17 at 12:38
  • Hello, i have designed an app using ionic and angularJS. the application is working fine when i am using http in api's. i wanted to use https in api's for security purpose . how can i make https request to web server via SSL in ionic framework. Any help appreciated. Thanks in advance. – Priyanka Jan 17 '17 at 10:51

0 Answers0