cordova-plugin-ios-xhr | Cordova iOS 6 File XHR Plugin | Mobile Application library
kandi X-RAY | cordova-plugin-ios-xhr Summary
kandi X-RAY | cordova-plugin-ios-xhr Summary
The default behavior of WKWebView is to raise a cross origin exception when loading files from the main bundle using the file protocol - "file://". This plugin works around this shortcoming by loading files via native code if the web view's current location has "file" protocol and the target URL passed to the open method of the XMLHttpRequest is relative. As a security measure, the plugin verifies that the standardized path of the target URL is within the "www" folder of the application's main bundle or in the /Library path of the application data directory. Since the application's starting page is loaded from the device's file system, all XHR requests to remote endpoints are considered cross origin. For such requests, WKWebView specifies "null" as the value of the Origin header, which will be rejected by endpoints that are configured to disallow requests from the null origin. This plugin works around that issue by handling all remote requests at the native layer where the origin header will be excluded. Fixes local file access via XHR with WKWebView. CustomUserAgent is only set for XHR requests and does not override cordova's OverrideUserAgent.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Body constructor .
- Constructs a new Request object
- Initialize the data .
- Construct headers object .
- Build iterator for value list
- Response constructor .
- Decode a form body .
- Parse a headers object
- Create a reader ready handler
- Clones the buffer .
cordova-plugin-ios-xhr Key Features
cordova-plugin-ios-xhr Examples and Code Snippets
Community Discussions
Trending Discussions on cordova-plugin-ios-xhr
QUESTION
I have converted an Angular project into a hybrid app following this guide: https://medium.com/@christof.thalmann/convert-angular-project-to-android-apk-in-10-steps-c49e2fddd29
For Android I did not run into many issues and the app is working as expected on that platform.
On IOS I ran into multiple difficulties. First of all in order contents display I needed to change the Angular LocationStrategy to HashLocation as describe in this SO topic:
Why Angular Router 8 router ...
Although I now do get content to render I still have trouble getting the dynamic content (i.e. the content requiring a call to a web server before rendering) to render properly.
My app has got a classic NavBar to switch from one component to another. If I activate one component by clicking on a Nav Button the static content gets rendered ok. However, the dynamic content is not there. I can verify this by looking at the source code: The holding the dynamic content is empty. If I click on the same Nav Button again the dynamic content is added. I get the same effect on an iPhone simulator and on a real device.
This is the html of one of the components
...ANSWER
Answered 2021-Jan-06 at 15:45After a lot of trial and error and searching I found the solution.
I found a hint here:
https://github.com/angular/angular/issues/7381[1]
For a reason I fo not fully understand yet the app seems to switch zones during the async call to the server. Therefore the UI change mechanism is not triggered and the screen is not updated.
By wrapping the changes of variables into NgZone.run()
the screen is updated correctly.
The updated .ts file
QUESTION
In my Cordova app, I have a problem after upgrading to cordova-ios 6.1.1. The app runs correctly, but the splash screen isn't showed. There is only a white screen, like if my splash screen files are ignored.
I have this config.xml file:
...ANSWER
Answered 2020-Oct-02 at 15:59I did it!!!!!
First of all, keep in mind you have to use only one image for the iOS splash screen, although the Cordova docs says you can also use multiple images like in the past.
So, in the root folder you need this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cordova-plugin-ios-xhr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page