SHIBU JOSEPH
SHIBU JOSEPH

Reputation: 11

ionic cordova not load data from server on devices

I am new to ionic application development. I am just using ionic sample project from their site. But the problem is that it works fine in browser. But not load data from server on device.

Error message shows

Failed to load resource: the server responded with a status of 404 (Not Found)

Upvotes: 1

Views: 3531

Answers (1)

Ophir Stern
Ophir Stern

Reputation: 1287

Given I can't just add comment (sad but true), I'll use a full blown answer. Take a look at the answer I published here, looks like it could be the same issue: https://stackoverflow.com/a/29953668/4509672

Highlights from it:

Depending on your Cordova version, as seen at Cordova Android 4.0.0 announcement, since Cordova 4.0.0 it could be you must add the cordoba-

Whitelist functionality is revamped

  • You will need to add the new cordova-plugin-whitelist plugin to continue using a whitelist
  • Setting a Content-Security-Policy (CSP) is now supported and is the recommended way to whitelist (see details in plugin readme)
  • Network requests are blocked by default without the plugin, so install this plugin even to allow all requests, and even if you are using CSP.
  • This new whitelist is enhanced to be more secure and configurable, but the Legacy whitelist behaviour is still available via a separate plugin (not recommended).
  • Note: while not strictly part of this release, the latest default app created by cordova-cli will include this plugin by default.

Upvotes: 7

Related Questions