Nate Kahl
Posts: 0
Joined: Fri May 17, 2013 7:03 pm

Access-Control -Allow-Origin

I am getting the following errors when attempting to send a text from my app:
Failed to load resource: The 'Access-Control-Allow-Origin' whitelists only 'https://www.twilio.com'. Origin 'http://appery.io' is not in the list, and is therefore not allowed access. https://api.twilio.com/2010-04-01/Acc...
XMLHttpRequest cannot load https://api.twilio.com/2010-04-01/Acc.... The 'Access-Control-Allow-Origin' whitelists only 'https://www.twilio.com'. Origin 'http://appery.io' is not in the list, and is therefore not allowed access.

I've tried using the appery.io proxy, i've added your IP address to the twillio account settings, but still get the errors. I've had this with a few services now and Can't figure out how to get past it.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Access-Control -Allow-Origin

Hello,

Please try to test the app without mobile frame or in Google Chrome with security disabled.
You should not get such error if you will test app on device.

http://docs.appery.io/documentation/c...

http://docs.appery.io/documentation/t...

Lionel Bartlett
Posts: 0
Joined: Fri Apr 04, 2014 1:53 am

Access-Control -Allow-Origin

It's true that the issue does not happen is you use the app on a device, however, Appery provide a Header option on the service request, so how can I add 'Access-Control-Allow-Origin' there (or anywhere else in the app) to avoid this error occurring? What is the syntax of the header and value?
Thanks.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Access-Control -Allow-Origin

Hello Lionel,

This issue should dissapear when you use Appery.io proxy.

1 Open your service.

2 Fill proxy field with your proxy id from http://docs.appery.io/documentation/s....

In case you won't get it working please send us your service screenshots (settings and test tabs) .

Lionel Bartlett
Posts: 0
Joined: Fri Apr 04, 2014 1:53 am

Access-Control -Allow-Origin

The proxy works thanks.

I'm accessing a XML service not hosted at Appery, so

  1. If I leave Proxy checked and compile app, will the compiled app still use the proxy?

  2. Does access through the Proxy count toward API calls, e.g. 1 mil - 15 mil depending on package.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Access-Control -Allow-Origin

Lionel,

1 Yes when you compile your application proxy still be used.

Solution: You can uncheck checkbox in the service when compile your application.

2 Yes. First your request is sent to the Appery.io proxy, then Appery.io proxy sends request to your external service when you use proxy.

This means you have double overhead on the tcp-ip connections.

Return to “Issues”