Cordova Slack Digest

Thu, 17 Sep 2020 08:24:28 GMT

User count: 4126

Join the conversation at slack.cordova.io

Channel #general (20 messages)


Wed, 16 Sep 2020 16:00:55 GMT

@osaintilien55 says

Are there certain CSS properties that do not work on Cordova? Or is every property supported?

Wed, 16 Sep 2020 16:07:07 GMT

@norman137 says

Cordova doesn‘t really dictate CSS or feature support in general. It’s the underlying webview that does. On android this can range, but on modern devices the webview can be updated independently (so feature support should be good for most user devices). On iOS, webview is tied to iOS version. Best to refer to https://caniuse.com/ for specifics, or refer to the MDN page for the particular CSS property to see browser compatibilty.

Most of the time, WKWebView behaves the same as mobile safari on the same iOS version, when it comes to JS and CSS.

Wed, 16 Sep 2020 16:16:58 GMT

@osaintilien55 says

Appreciate it!

Wed, 16 Sep 2020 16:19:56 GMT

@norman137 says

Small correction to my statement, Cordova does fill in gaps where browser support is lacking or extremely inconsistent, by providing a native implementation in the forms of plugins, ie. the cordova-plugin-file for filesystem support. But this generally only applies to javascript features, not css features.

Wed, 16 Sep 2020 16:31:09 GMT

@osaintilien55 says

Okay so just to be sure I understand clearly. “Generally Speaking” The webview version of a device is tied to the version of the device's OS. And so with the caniuse website I can find out which version of any OS where a CSS property would not be supported.

Is there a way I can find out which device's webview update independently?

Wed, 16 Sep 2020 16:37:47 GMT

@norman137 says

android allows the webview to be updated independent starting android 5.x. cordova-android@9 min android support is 5.1, so if you're using the latest version of cordova-android@9 any user should be running on an android OS version that allows the webview to be updated independently from the OS.

Whether the user actually installs updates is another question however, so just because they are on an android device, doesn‘t mean they have access to the latest version of the chrome webview. Also... my android 5 device seems to stop receiving updates for the chrome webview, as it’s on chrome 77 without any updates available, so for older devices updates may be cut off as well, but I'm not exactly sure on the policy.

Wed, 16 Sep 2020 16:38:28 GMT

@norman137 says

iOS devices don't have updatable webviews. They are baked into the OS, so the webview updates with the OS updates.

Wed, 16 Sep 2020 16:45:45 GMT

@osaintilien55 says

Hmm okay got it. In general are there certain CSS properties that you try to avoid using?

Wed, 16 Sep 2020 16:47:59 GMT

@norman137 says

ios and android css support is pretty good, I can't think of anything I avoid for support reasons...

Wed, 16 Sep 2020 16:48:57 GMT

@norman137 says

most of the time you only have to worry about CSS support if you're using bleeding edge css features or if you have to support IE.

Wed, 16 Sep 2020 16:49:42 GMT

@osaintilien55 says

Got it okay

Wed, 16 Sep 2020 16:50:41 GMT

@dpogue says

Avoid using filter (or -webkit-filter) on iOS, it can cause super buggy rendering glitches

Wed, 16 Sep 2020 17:17:08 GMT

@jberman says

Hey guys, my Cordova app loads some initial content from the local device, but then also makes XHR requests to user-defined servers. I’m in the process now of moving to cordova-ios 6.1.0 and figuring out the CORS issues and what needs to change in our products to keep things working. I’ve read @norman137’s excellent blog post on CORS as well as every piece of documentation I could find. Is it fair to say that if you want to avoid any hacky solutions, the only way to proceed is to specify a custom scheme in the cordova app and then configure each server to allow that scheme?

Wed, 16 Sep 2020 17:21:04 GMT

@norman137 says

using schemes will help relieve CORS-related issues on local resources, because while on the file:// protocol, everything is considered a cross-origin request.

Then for external resources, the webserver must use the CORS headers to allow that scheme yes. If your server is used for multiple purposes (such as to power a website and your cordova app), then you may need business logic to hold a list of acceptable origin points and only return the Access-Control-Allow-Origin header if the request origin is acceptable.

Wed, 16 Sep 2020 17:23:41 GMT

@jberman says

Right, you explained that very well in your blog post — thank you. I just wanted to make sure there was no legitimate client-side solution, and it sounds like there’s not. For the scheme, is that “app/localhost” just an example scheme name? Would it make sense to replace it with our app’s name, or just use “app” and “localhost”?

Wed, 16 Sep 2020 17:24:44 GMT

@norman137 says

that‘s the default value if you have schemes enabled, but you can change it to whatever you desire, for as long as the scheme isn’t conflicting with a “well-known scheme” such as http or https.

Wed, 16 Sep 2020 17:25:05 GMT

@norman137 says

Once you pick on, it's best to stick with it, because it changes the origin point, thus your web storage containers.

Wed, 16 Sep 2020 17:25:06 GMT

@jcesarmobile says

Client side the only way is by using a http plugin that uses native connections

Wed, 16 Sep 2020 17:33:28 GMT

@jberman says

@jcesarmobile Is a native connection plugin a drop-in replacement, or does it come with its own set of issues and code changes?

Wed, 16 Sep 2020 17:33:40 GMT

@jberman says

Thanks Norman, I appreciate the info!

Channel #cordova-ios (1 messages)


Wed, 16 Sep 2020 11:45:03 GMT

@vittalpai says

Hi Team,

My Cordova plugin fails to load webpage from sandbox with cordova-ios 6.x and it fails with the following error.

MyApp[1915:835462] Failed to load webpage with error: The operation couldn't be completed. (kCFErrorDomainCFNetwork error 1.) Tried with loadFileURL and loadRequest APIs. Both are failing with same error

Interestingly, this issue is reproducible only in 12.x device not in simulator. Any help is much appreciated. Thanks

Channel #plugins (3 messages)


Wed, 16 Sep 2020 20:09:46 GMT

@jose2013 says

Please, how can I enable the runOnlyForDeploymentPostprocessing flag in a plugin? This how I’doing but it does not work 😛

    shellPath: '/bin/sh', 
    shellScript: 'echo "testing..."',
    runOnlyForDeploymentPostprocessing: true
  };
  var buildPhase = xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Hello test', xcodeProject.getFirstTarget().uuid, options).buildPhase;```


Wed, 16 Sep 2020 20:10:15 GMT

@jose2013 says

I’ve tried as runOnlyForDeploymentPostprocessing: 1 as well 😞

Wed, 16 Sep 2020 20:53:33 GMT

@jose2013 says

oh no, it is hard coded: https://github.com/apache/cordova-node-xcode/issues/49