# API calling not work in IOS build

**URL:** <https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547>\
**Category:** ionic-v3\
**Created:** [October 21, 2017, 9:29am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547 "2017-10-21T09:29:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faizyfaazz](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@Faizyfaazz](https://forum.ionicframework.com/u/Faizyfaazz)\
**Post date:** [October 21, 2017, 9:29am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/1 "2017-10-21T09:29:05Z")

</div>

In my ionic project i used private api to get flight details. it successfully work in android build. When i create IOS build it didn’t show anything from the api. how can i solve this issue?

```auto

get_arrivalflights() {

    var communicationParams = {
      showLoader: true,
      reqUrl: "",
      reqBody: {},
      callBackSuccess: (response) => {
        console.log(response);
        this.objectData = response.flightStatuses;
      
      },
      callBackFailure: (response) => { console.log("failure dude"); console.log(response); }
    };
    this.restservice.makeGetRequest(communicationParams);
  }

```

```auto
makeGetRequest(communicationParams: any) {
    
  this.baseUrl = " the url i want to call ";

    var loader;
    if (communicationParams.showLoader == true) {
      loader = this.loadingController.create({
        content: ""
      });
      loader.present();
    }
    this.http.get(this.baseUrl + communicationParams.reqUrl)
      .map(response => response.json())
      .subscribe(communicationParams.callBackSuccess, function(respone) {
          if (communicationParams.showLoader == true) {
            loader.dismiss()
          }
          communicationParams.callBackFailure(respone);
        },
        () => {
          console.log('Authentication Complete');
          if (communicationParams.showLoader == true) {
            loader.dismiss()
          }
        });
  }

```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [October 21, 2017, 11:35am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/2 "2017-10-21T11:35:29Z")

</div>

What is your `ionic info` output?  
How are you building and testing the app?  
What protocol does the API endpoint use?

---

<div class="post-metadata">

**Author:** ![Faizyfaazz](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@Faizyfaazz](https://forum.ionicframework.com/u/Faizyfaazz)\
**Post date:** [October 21, 2017, 11:44am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/3 "2017-10-21T11:44:06Z")

</div>

ionic info:

```auto

cli packages: (/usr/local/lib/node_modules)
    @ionic/cli-utils : 1.9.2
    ionic (Ionic CLI) : 3.9.2
global packages:
    Cordova CLI : 7.0.1 
local packages:
    @ionic/app-scripts : 3.0.0
    Cordova Platforms : ios 4.5.2
    Ionic Framework : ionic-angular 3.7.1

System:
    Node : v6.11.2
    npm : 3.10.10 
    OS : macOS Sierra
    Xcode : Xcode 8.3.3 Build version 8E3004b

```

building and testing of the app working perfectly.  
API data displayed correctly in ionic serve and android build APK . but not in ios build file(in simulator)

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [October 21, 2017, 11:47am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/4 "2017-10-21T11:47:37Z")

</div>

> [@Sujan12](#):
>
> How are you building and testing the app?
> 
> What protocol does the API endpoint use?

Please don’t answer to similar questions, but to exactly those. What exact commands are you using? We need these answers to know what is going on.

---

<div class="post-metadata">

**Author:** ![Faizyfaazz](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@Faizyfaazz](https://forum.ionicframework.com/u/Faizyfaazz)\
**Post date:** [October 21, 2017, 11:56am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/5 "2017-10-21T11:56:48Z")

</div>

> [@Sujan12](#):
>
> How are you building and testing the a[quote=“Sujan12, post:4, topic:109547”]  
> How are you building and testing the app?

cordova build ios

---

<div class="post-metadata">

**Author:** ![inagtech](https://avatars.discourse-cdn.com/v4/letter/i/76d3ee/32.png) [@inagtech](https://forum.ionicframework.com/u/inagtech)\
**Post date:** [April 26, 2018, 10:50am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/6 "2018-04-26T10:50:09Z")

</div>

Am finding the same issue the application is working perfectly when I hit the api in ionic serve and Android build.  
If I build the same in iOS its not working

---

<div class="post-metadata">

**Author:** ![nadeemmdsol](https://avatars.discourse-cdn.com/v4/letter/n/b3f665/32.png) [@nadeemmdsol](https://forum.ionicframework.com/u/nadeemmdsol)\
**Post date:** [October 30, 2018, 7:23am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/7 "2018-10-30T07:23:03Z")

</div>

I am also facing same issue.

---

<div class="post-metadata">

**Author:** ![pksquare](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@pksquare](https://forum.ionicframework.com/u/pksquare)\
**Post date:** [August 26, 2020, 6:19am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/8 "2020-08-26T06:19:57Z")

</div>

did you find the solution ?

---

<div class="post-metadata">

**Author:** ![pksquare](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@pksquare](https://forum.ionicframework.com/u/pksquare)\
**Post date:** [August 26, 2020, 6:20am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/9 "2020-08-26T06:20:12Z")

</div>

did you find the solution?

---

<div class="post-metadata">

**Author:** ![jackandersonaj1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jackandersonaj1/32/133676_2.png) [@jackandersonaj1](https://forum.ionicframework.com/u/jackandersonaj1)\
**Post date:** [August 26, 2020, 6:27am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/10 "2020-08-26T06:27:41Z")

</div>

This post was flagged by the community and is temporarily hidden.

---

<div class="post-metadata">

**Author:** ![jackrootaj](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jackrootaj/32/133679_2.png) [@jackrootaj](https://forum.ionicframework.com/u/jackrootaj)\
**Post date:** [August 26, 2020, 7:16am UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/11 "2020-08-26T07:16:56Z")

</div>

This post was flagged by the community and is temporarily hidden.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 8:54pm UTC](https://forum.ionicframework.com/t/api-calling-not-work-in-ios-build/109547/12 "2021-07-19T20:54:13Z")

</div>

Closed on July 19, 2021, 8:54pm UTC


