Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Ionic $http request with 403 error on iPad device

$
0
0

@zhangzzh wrote:

I'm scratching my head with one problem in ionic.
I have an app, I run it with simulator (ionic emulate -lcs), works find, $http can call the backend service with post. But after I deploy this app on to my iPad, same http call gets 403 error.

The backend server is an apache httpd server, I have added the "Header set Access-Control-Allow-Origin "*"" to httpd configuration file.
config.xml have all three whitelist tags:

  <access origin="*"/>
  <allow-intent href="*"/>
  <allow-navigation href="*"/>

Also in plist file of the iOS project, I have the NSAppTransportSecurity configured:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

Same code runs on iPad got a 403 forbidden issue.

Can anybody help me with this? thank you.

cordova plugin list:
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-contacts 2.0.1 "Contacts"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-inappbrowser 1.2.1 "InAppBrowser"
cordova-plugin-splashscreen 3.1.0 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.0.1 "Keyboard"

codova version 6.0.0
ionic version 1.7.14

code of making $http request:

  .factory("Service", function($http){
    return {
      requestPayment : function(uuid, eventId, request){
        $http.post("https://hostinfo/"+uuid+"/"+eventId, request).then(
          function successCallback(response) {
            console.log(response);
          }, function errorCallback(error) {
            console.log("Error:"+JSON.stringify(error));
          }
        );
      }
    }
  });

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>