No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    API Call does not work in ios Mobile App version

    Framework
    4
    11
    737
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Siddharth last edited by

      We have created Hybrid mobile app to work in browser, as an Android App and iOS app. We have 3rd party APIs called in the App. These work fine browsers and Android app, but throws exception in iOS app. Can anyone please help on what can be the issue or probable solution for this?

      Below is the code. Exception when printed shows empty string {}, so not able to figure out what is the exact issue in iOS.

      /*
      export function someAction (context) {
      }
      */
      import Vue from ‘vue’
      import {Notify, Loading, LoadingBar} from ‘quasar’

      export const doRecipes = ({state, commit, dispatch}) =>{
      Loading.show()
      LoadingBar.start()
      return Vue.prototype.$axios
      .get(API Call here)
      .then(response => {
      console.log(response)
      commit(‘SetRecipes’,response.data)
      Loading.hide()
      LoadingBar.stop()
      return response;
      })
      .catch(e => {
      Loading.hide()
      LoadingBar.stop()
      return e;
      })
      }

      1 Reply Last reply Reply Quote 0
      • S
        Siddharth last edited by

        Follow up comment -
        Experts,
        Please let us know if you have faced similar issue or pointers to debug this issue.

        I 1 Reply Last reply Reply Quote 0
        • I
          Ilia @Siddharth last edited by

          @Siddharth
          Can you add log to catch block and post here the full text it shows from console?

          .catch(e => {
            Loading.hide()
            LoadingBar.stop()
          
            console.log(e)
          
            return e;
          })
          
          1 Reply Last reply Reply Quote 0
          • S
            Siddharth last edited by

            Thanks @Ilia for the response.

            We had tried this earlier
            .catch(e => {
            console.log(“blog error”)
            console.log(e)

            and response was as follows:
            2020-12-01 11:02:18.684446+0530 Food Finder[2003:71399] blog error
            2020-12-01 11:02:18.685218+0530 Food Finder[2003:71399] {“config”:{“transformRequest”:{},“transformResponse”:{},“timeout”:0,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1,“headers”:{“Accept”:“application/json, text/plain, /”},“method”:“get”,“url”:“API”},“request”:{}}
            2020-12-01 11:02:18.689187+0530 Food Finder[2003:71399] ERROR: {}

            Error just shows {}

            So kind of stuck and not able to understand how to proceed.

            dobbel 1 Reply Last reply Reply Quote 0
            • I
              Ilia last edited by

              OK, in config.xml try this tags: <allow-navigation href=“https://yourdomain.com/*” /> and re-build the app. Also check if the app is allowed to make internet calls at all.

              Also, after that just in case, try to switch to another web-view and see if that makes any difference: https://quasar.dev/quasar-cli/developing-cordova-apps/preparation#Switching-to-iOS-WkWebView

              For now, that’s all I can think of, sorry…

              1 Reply Last reply Reply Quote 0
              • dobbel
                dobbel @Siddharth last edited by

                @Siddharth

                Are you using wkwebview? If not you should do that first.

                https://quasar.dev/quasar-cli/developing-cordova-apps/preparation#Switching-to-iOS-WkWebView

                1 Reply Last reply Reply Quote 1
                • S
                  Siddharth last edited by

                  Thanks a lot @Ilia @dobbel . I will check with my Team on this.

                  dobbel 1 Reply Last reply Reply Quote 1
                  • dobbel
                    dobbel @Siddharth last edited by

                    @Siddharth

                    wkwebview

                    You’ll need it to pass the iOS App review.

                    1 Reply Last reply Reply Quote 0
                    • S
                      Siddharth last edited by

                      Thanks a lot @dobbel @Ilia for your responses.
                      Just to let you know, we introduced integration platform(Mulesoft) to handle the API calls to 3rd parties from our Application. This way we eliminated the need for wkwebview or the need for 3rd party to make a change to their server settings(to handle external calls). So from our Application point of view, this issue was resolved for ios.

                      dobbel 1 Reply Last reply Reply Quote 0
                      • dobbel
                        dobbel @Siddharth last edited by dobbel

                        @Siddharth

                        Great you solved the issue.

                        This way we eliminated the need for wkwebview

                        If you don’t have wkwebview than you’ll use UIWebView(default). Apple will (automatically) reject any webview based app uploaded to the iTunes store with code(used or not) that contains UIWebView.

                        1 Reply Last reply Reply Quote 0
                        • F
                          fabrezey_fresh last edited by

                          I am having the exact same issue today and unfortunately introducing an integration platform like Mulesoft is not an option. I posted in the capacitor Discord channel today and it’s been crickets.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post