My application is connecting to an API through https and it is working fine in Emulator, but when i pushed to Server and tested in my Samsung mobile device ( A8), i am not getting the expected response, looks device couldn't able to connect to https, how could i debug this issue
連結已複製
Hello,
Can you try building your app and installing on device? App preview has some limitations so it is better to check by insatlling app on device.
To find more about how to build? please refer this: https://software.intel.com/en-us/xdk/docs/using-the-build-tab
Emulator is just a simulator. There are some limitations just check out this link: https://software.intel.com/en-us/xdk/docs/dev-emulator
Try to build with crosswalk and use either build or debug tab to see the actual behavior of the app.
Also make sure you have included the site in your whitelist information in the projects tab under build settings. You can read more about it here: https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk?language=en
Thirukkumaran -- can you provide a sample app that illustrates what you are trying to do and results in the failure? Create a simple app that results in the failure and ZIP the entire project directory for that app. Then attach the ZIP to your post, using the "attach media" button (scroll down below your edit window).
Hi Thiru, I'm afraid this sample app is not helping me understand the issue. I see that you have configured an AJAX call that references a URL named https://xxx/ -- which fails on the Emulate tab because that is an unresolvable address. You have set the "Network Requests (Internal Whitelist)" to "*" and left the "Intent" whitelist empty. I'm assuming the URL you are using is a valid URL? What happens if you put an "*" in the Intent whitelist, as well?
HI Paul
sorry that i cant provide the URL, but the URL is valid and it is working fine in emulator, i tried below options
1) "*" for "Network Requests (Internal Whitelist)" and "*" for "Intent whitelist empty",
2) "*" for "Network Requests (Internal Whitelist)" and empty for "Intent whitelist empty",
3) "https://*" for "Network Requests (Internal Whitelist)" and "https://*" for "Intent whitelist empty",
Note that i have tried these options in "Crosswalk for Andorid" build & "Android" build, and tested in Samsung A8 model, let me know if i need to enable any options in my mobile,
1 more issue is, when i tried to build fo iOS, i have got the attached certificate error, i have downloaded the certificate from step 1a and tried to upload in step 1b in "iOS certificate", could you check and advise.
Regards
Thiru
Paul
I have identified the issue, the request header Origin is set to "file://" if i invoke https URL from my mobile and the URL is not allowing this origin value, i simulated this case in SOAP UI and i have got the same error response when i pass origin as "file://" and it works finr for "file://1" in SOAP UI,
could you advise how can i setup the default origin for https calls.
Regards
Thiru
Thiru, if you are trying to post a file to your server, you might be better off using the Cordova file-transfer plugin to accomplish that. I suspect it exists for this very reason that you are describing.
Paul
I am not posting a file, i am sending user id and password in post call to authenicate using an URL, but origin header is going as "file://" from my mobile in ajax call, hence the request has been rejected from server,
could you advise how the origin has been set ?
Regards
Thiru
That would be the appropriate origin, since your app is not associated with a domain or web server, it is a standalone app that just happens to use HTML5 as the language. There are some sample apps that have been built by one of my colleagues that cover logging into a site using OAuth techniques.
https://software.intel.com/en-us/xdk/article/oauth2-with-intelxdk-cordova-html5
https://software.intel.com/en-us/xdk/docs/oauth2authentication
https://github.com/krisrak/jquery-cordova-oauth2
