android - ionic 2: while run in emulator it shows error but running in server it works -


something weird happened me after add plugins in app.. when run

ionic run serve

the app work find , can response server can see here enter image description here

but run

ionic run android

it show spinner , shows error can see here

enter image description here

to http requests via ionic app, need white list urls. can use cordova whitelist plugin this.

cordova plugin add cordova-plugin-whitelist

and in index file

<meta http-equiv="content-security-policy" content="script-src 'self' 'unsafe-eval' 'unsafe-inline' *; object-src 'self'; style-src 'self' 'unsafe-inline'; media-src *">

this code copied following tutorial, have @ it.

http://www.gajotres.net/ionic-2-making-rest-http-requests-like-a-pro/

hth


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -