Error iOS "Status": 0. iOS 9+, App Transport Security


#1

Error with Http.request returns a response with the data
"Status": 0, “ok”: false, “statusText”: “”, “headers”: {}, “type”: 3, “url” : Null}
Only in iOS 9+, so vi is something involved with App Transport Security, I already configured Allow Arbitrary Loads.


let headers = new Headers({'Content-Type': 'application/json',
    'Authorization': 'Basic',
    'MerchantId': this.MerchantId,
      'MerchantKey': this.MerchantKey,
      'Access-Control-Allow-Origin': '*' });
    let body = (this.paymentSend);
    let options = new RequestOptions({
      method: RequestMethod.Post,
      url: 'https://api.com.br',
      headers: headers,
      body: body
    });


return this.http.request(
      new Request(options)).toPromise()
      .then(response => {
        this.payment = response.json();       
      }).catch((err)=>{
          console.error(err)
         });

#2

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Also posting only an error message without any additional information of even a question is a bit impolite to the users here.

What is you ionic info output?

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Safari dev tools: https://ionic.zone/debug/remote-debug-your-app#ios Look at the console and network tabs for errors.


#3

I have the same issue as @wilsoncx above. I’ll be debugging today to determine what the cause is, but if anyone has any ideas why this might be happening it would be greatly appreciated.

I am using WKWebView.

image


#4

Any update on this? I think I might have the same issue?