I have created an app, based on the iconic 3. The app works perfectly on the browser as I have used HTTP requests but now it’s not working on the real device. The API I used also works fine on the postman. Please suggest what went wrong. And app previously works on the real device too.
But I unable to debug it more. I have installed whitelist plugin.
On what platform do you want to run it? Does it open on your device or throw an error in console?
Please also run the following command ionic info
and post your result.
Have you updated some dependencies or the ionic cli?
I want to run it on android. Yes, it opens up on the device, but when I trying to make any HTTP request it shows nothing when I debug the request it does not show me header and response body whereas browser shows.
If you configure your settings correctly angular’s http client should work fine. I have some apps in production that work without any problems.
But I encountered some problems with ionic native http. I would recommend to use angular’s http client if you don’t need any of the following advantages and don’t encounter any problems, because the ionic native http plugin adds at least two more dependencies to your app and in addition increases your app size.
Advantages over Javascript requests:
Background threading - all requests are done in a background thread
It does not work for me on the real device, but works on emulator. Below is the error
Response {body: ProgressEvent, status: 0, ok: false, statusText: “”, headers: Headers, …}
_ body:ProgressEvent {isTrusted: true, lengthComputable: false, loaded: 0, …}
_ headers:Headers {headers: Map(0), normalizedNames: Map(0)}
_ ok:false
_ status:0
_ type:3_
_ url:null_ proto:Body {constructor: , toString: }
_ arguments:TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them_
_ caller:TypeError: ‘caller’, ‘callee’, and ‘arguments’ properties may not be accessed on strict mode functions or the arguments objects for calls to them_
My issue was that the real device could not connect the server because I deployed the server locally on my laptop. My solution is deploying on Heroku, then it works. Thanks!
i add and removed the platforms many times but no success found, app is crashing still now. i dont where problem is there. please help me as soon as possible , its urgent.