# Ionic mobile issue

**URL:** <https://forum.ionicframework.com/t/ionic-mobile-issue/158479>\
**Category:** ionic-v3\
**Created:** [March 7, 2019, 2:50pm UTC](https://forum.ionicframework.com/t/ionic-mobile-issue/158479 "2019-03-07T14:50:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sureshvgp](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@sureshvgp](https://forum.ionicframework.com/u/sureshvgp)\
**Post date:** [March 7, 2019, 2:50pm UTC](https://forum.ionicframework.com/t/ionic-mobile-issue/158479/1 "2019-03-07T14:50:11Z")

</div>

Hi,

We created the application using ionic 3.0. We are not building through Cordova but just running the app by ionic serve, like a web application.

Able to access the application in the browser but having an issue when access through a mobile browser.

Request and Response details:

URL: [http://demo.test.com:8081/accounts/api/authentication/token](http://demo.test.com:8081/accounts/api/authentication/token)  
Request Method: POST  
Request Header as : X-Api-Key=b4dbbd20-d3ab-11e8-a63f-4b1153c47651  
Response (Laptop): Able to get the response  
Response (Mobile): Getting error: Response with Status:0 for URL:null

Sample code:

**In service class:**

public anonymouslogin(apiKey):Observable {

```
let body = {
};
if (apiKey === null) {
  return Observable.throw("Please insert account.");
} else {
    let url = AuthServiceProvider.LOGIN_URL_APIEY;
    let headers = new Headers(
        {
            "X-Api-Key": localStorage.getItem("apikey")
        });
    
    let options = new RequestOptions({ headers: headers });
	alert("Initiated Post Request (in mobile not seeing any alert after this");
    return this.http.post(url, body, options)
        .map(response => {
			alert('success');//This alert not coming desktop but not in mobile.
            var temp = response.json();
            return true;
        },
        (error) => 
        {
			alert('Failure');//This alert not coming in mobile even if get error.
            return false;
        }
    );

```

}  
}

**In component:**

this.auth.anonymouslogin(localStorage.getItem(“apikey”))  
.subscribe(allowed =\> {  
alert(‘Login success’);  
},  
(error) =\>  
{  
alert(“This is error displaying in the mobile only”+error);  
//Error objct as like this. ‘Response with Status:0 for URL:null’

```
        }
);

```

Not sure about the reason why this breaking in mobile.Same issue in both Android and IOS device.
