Results 1 to 3 of 3

Thread: CORS referring domain when packaged natively

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012

    Default CORS referring domain when packaged natively

    I'm weeks away (due to red tape) at wrapping my app up natively with Sencha and getting it installed on a device but I have a strong concern after recently completing CORS setup on my app and that is What will the referring domain be for Ajax request if an application is natively wrapped?

    As I understand CORS, to access Web Services that require authentication one must set "withCredentials" to true and on the apache side you mention what domain(s) are allowed to access your site as such

    Header set Access-Control-Allow-Origin http://localhost

    as "wildcarding" is not allowed when you have withCredentials set to true in the Sencha app

    When the app is simply a url like the answer is very clear what the referring domain will be to the web service, it will be "" but when it is natively wrapped and is opened via an icon on the iPad I don't have a clue what that referring domain will be. And further more am worried that it will be something random and unpredictable leaving me to scramble to create some sort of alternative to "withCredentials: true" because I will not be able to define those incoming domains for CORS to the WEB service.

    Many thanks


  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    If you are in a packaged app then you won't be able to use CORS as you don't have a domain or a steady IP (unless you try to capture the IP and return it in your server side code for the header, not sure if that would work or not). I don't believe that Phonegap has the CORS issue but could be wrong.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2012


    Yes, this will be a packaged app.

    A little more clarity please, are you saying that with Sencha Native Packaged app I will not be able to perform POST or PUT request to a Web Service because CORS will cause errors?

    And/Or are you saying that yes I will have CORS errors when attempting POST or PUT functions with Sencha native packaged app BUT if I use PhoneGap packaging these problems do not happen?


    Kris Thompson

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts