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

    How to config xginx api server to accept requests from android/ios apps?

    Quasar Play App
    android api cordova cors
    4
    6
    251
    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.
    • R
      realtebo last edited by

      I’m developing a web app since a while. Now we’re tring to run it as a mobile app (android only in this moment).

      We stopped becase all api calls from mobile app is being blocked because of cors policy.

      I’ve not a clear idea of how cors headers and preflight options calls works.

      Anyway, I ask you kindly if there is something from quasar app code side to be done to be able to make api calls.

      I never faced problem in calling apis using native java android apps. I stupidly thinked it wil not be a problem in a quasar cordova mode app.

      Please, help me to understand what should I do to allow my app to make api calls.

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @realtebo last edited by

        @realtebo cors is a server side setup, use some google fu, many resources out there about it.

        1 Reply Last reply Reply Quote 1
        • R
          realtebo last edited by

          I understand it’s most server side. But I cannot understand why quasar app has this problems while native java android app has not problem doing requests to web services.

          qyloxe 1 Reply Last reply Reply Quote 0
          • qyloxe
            qyloxe @realtebo last edited by

            @realtebo said in How to config xginx api server to accept requests from android/ios apps?:

            I understand it’s most server side. But I cannot understand why quasar app has this problems while native java android app has not problem doing requests to web services.

            probably because java xmlhttp transport is less secure. CORS is a browser thing and it may or may not be implemented. If it is, then it needs supporting server. It is good, that CORS is implemented. Very good.

            1 Reply Last reply Reply Quote 1
            • metalsadman
              metalsadman last edited by

              What qyloxe said, unless you use a native http client (dunno if cordova has, i use d to use retrofit owhen i was doing native android) you will have to set cors in your server since cordova is runnning on a webview which uses browser technology. Some reading https://ionicframework.com/docs/troubleshooting/cors

              1 Reply Last reply Reply Quote 1
              • R
                realtebo last edited by

                We resolvede server side on development using a proxy bypass with origin rewrite. For production server we’re unable to enable origin ‘*’ so we’ll try to add a reverse proxy or a pass through proxy like done in development.

                Thanks

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