cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HAT iOS: [Error] Origin null is not allowed by Access-Control-Allow-Origin.

0 Kudos

Hi folks,

I have developed a mobile app using SAP Hybrid Application Toolkit(HAT) which works fine on Android but when it comes to iOS, attachments are not getting uploaded to backend. I am using the UploadCollection control to upload files. I checked console log and got this

Network preview

I tried setting up the header parameter via controller Access-Control-Allow-Origin: *but it didn't work. Maintained following entries in config.xml file

<access origin="*" />

<allow-navigation href="*" />

<customHeaders>

<add name="Access-Control-Allow-Orixgin" value="*" />

</customHeaders>

still the Origin is always NULL.

All other functionality of the app are working fine only while uploading attachments (file://) the backend call is failing. Can anyone help on this?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Kathat,

The null origin should be added in Mobile Service cockpit instead of the config.xml file. Please refer to https://blogs.sap.com/2020/03/16/hybrid-application-toolkit-apps-for-ios-switching-to-wkwebview/ on how to do it.

Regards,

Zhigao

0 Kudos

It's working now.Thanks a ton, Chen.

Answers (0)