Open and add in the following proxies setup. The origin in this case is localhost:8100, which when you contact an external service via HTTP with CORS enabled, they deem the request not trustworthy and therefor reject it.Īs suggested by Ionic themselves ( ), you can create a proxy alias within the Ionic app to route the API calls via, avoiding the origin issue altogether, however, their guide was specific for Ionic 1, so here is an update for Ionic v2. Start MacPass and open Preferences Go to Plugins Section Drag the MacPassHTTP. Fortunately, with ionic-native-http-connection-backend library you can use the same HttpClient service for. Restart MacPass if you're already running it. However, in web enviroment you still need to use Angular's HtttClient. MacPassHTTP KeePassHTTP plugin for MacPass Dependencies KeePassHTTPKit MacPass Source Installation Using a precompiled version Download the latest release from the Releases page, extract, and copy the resulting file to the MacPass plugin folder at /Library/Application Support/MacPass/. When developing locally using ionic serve or ionic run/emulate -l -c with livereload enabled, ionic creates a local dev server at port 8100 by default ( ). If you have no way to change the server configuration, you should use Http native plugin to perform Http requests from your mobile device, to prevent cors problems.
0 Comments
Leave a Reply. |