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

V6 localhost API error - Could not connect to the server/access control checks?

$
0
0

Hello all,

This is my first ionic app and things have been going quite well - I’ve been developing an app to allows users to track their geolocation so they can be guided to locations on a map to take a photo. Local development on my browsers has been fine but I’m running into an issue when I try to reach my local Django server at http://localhost:8000/api/v1/signin/ from my iPhone while connected to my laptop. I use axios to make this request.

Initially I believed this was a CORS issue, but my local server is configured to allow all access - here is the same request from the browser:

I have been following the instructions here: https://eliteionic.com/tutorials/accessing-localhost-from-mobile-device-ios-android/

And I have also set various settings in my Info.plist to YES:
NSAllowsLocalNetworking - YES
NSAllowsArbitraryLoads - YES
NSAllowsArbitraryLoadsInWebContent - YES

Sadly, none of these have helped and I still see that error “could not connect to server” and “XMLHttpRequest cannot load … due to access control checks”. What am I missing?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles



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