user2413453
user2413453

Reputation:

Ionic View app not retrieving data

I am busy testing my app, so far it works in my browser but in the ionic view (IOS) app it does not.

The problem in the app it self is that it is not loading any data.

My setup is like this - WCF RESTful <-> IIS <-> app.

So as I mentioned it works in my browser, that means IIS and my Service is working fine. But now I do not know if it is the Ionic View app, IOS or something else?

Upvotes: 0

Views: 130

Answers (1)

MHX
MHX

Reputation: 1601

My first guess would be that you're having problems with 404-erros in your requests.

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 Cordova Whitelist plugin.

You can find more documentation on Ionic docs: Cordova Whitelist.

Solution:

Run the following command in your shell/terminal:

ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git

The only thing you need to do now is to add a property to your config.xml file:

<access origin="http://google.com" />

Where in the config.xml file should this be placed? (simplified config.xmlexample)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.myApp" version="1.0.0">
    <name>myApp</name>
    <content src="index.html"/>
    <!-- Allows access to maps.google.com and docs.google.com -->
    <access origin="http://google.com" subdomains="true" />
    <access origin="https://fonts.googleapis.com"/>
</widget>

Upvotes: 0

Related Questions