{"_id":"56d1f34100a2a70b00b365f9","__v":0,"user":"5526d4bb4a7ac121004c605c","version":{"_id":"56d1f33700a2a70b00b3658e","project":"5526c95cf69851170038b48f","__v":2,"createdAt":"2016-02-27T19:04:23.946Z","releaseDate":"2016-02-27T19:04:23.946Z","categories":["56d1f33900a2a70b00b3658f","56d1f33900a2a70b00b36590","56d1f33900a2a70b00b36591","56d1f33900a2a70b00b36592","56d1f33900a2a70b00b36593","56d1f33900a2a70b00b36594","56d1f33900a2a70b00b36595","56d1f33900a2a70b00b36596","56d1f33900a2a70b00b36597","56d1f33900a2a70b00b36598","56d1f33900a2a70b00b36599","56d1f33900a2a70b00b3659a","571f9497ada30c34003b7cee"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta","version_clean":"2.0.0-beta","version":"2.0.0-beta"},"category":{"_id":"56d1f33900a2a70b00b36590","version":"56d1f33700a2a70b00b3658e","__v":1,"pages":["56d1f34100a2a70b00b365f8","56d1f34100a2a70b00b365f9","56d1f34100a2a70b00b365fa"],"project":"5526c95cf69851170038b48f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-15T18:49:19.951Z","from_sync":false,"order":9,"slug":"environment","title":"Debugging"},"parentDoc":null,"project":"5526c95cf69851170038b48f","updates":["5628f6cc0f90450d0061b0a8","5638723e2fc5520d001a4c14"],"next":{"pages":[],"description":""},"createdAt":"2015-05-15T18:47:50.751Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"If you're using a newer version of Cordova (or the latest Ionic CLI) to develop your app, you may be experiencing http 404 errors when your app tries to make network requests.  \n\nThis can be solved quickly with the [Cordova whitelist plugin](https://github.com/apache/cordova-plugin-whitelist)!  To install it, just run the following in your project's directory:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nNow, you just need to whitelist the relevant domains in your app's `config.xml`.  For example, here's how you would whitelist all net traffic:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<allow-navigation href=\\\"*\\\" />\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Warning:\",\n  \"body\": \"The above example will whitelist the entire network, and as such is **not recommended** for a production application, though it's just fine in testing.\"\n}\n[/block]","excerpt":"Solve 404 errors with the whitelist plugin","slug":"cordova-whitelist","type":"basic","title":"Cordova Whitelist"}

Cordova Whitelist

Solve 404 errors with the whitelist plugin

If you're using a newer version of Cordova (or the latest Ionic CLI) to develop your app, you may be experiencing http 404 errors when your app tries to make network requests. This can be solved quickly with the [Cordova whitelist plugin](https://github.com/apache/cordova-plugin-whitelist)! To install it, just run the following in your project's directory: [block:code] { "codes": [ { "code": "ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git", "language": "shell" } ] } [/block] Now, you just need to whitelist the relevant domains in your app's `config.xml`. For example, here's how you would whitelist all net traffic: [block:code] { "codes": [ { "code": "<allow-navigation href=\"*\" />", "language": "xml" } ] } [/block] [block:callout] { "type": "danger", "title": "Warning:", "body": "The above example will whitelist the entire network, and as such is **not recommended** for a production application, though it's just fine in testing." } [/block]