Cordova Slack Digest

Thu, 20 Aug 2020 08:21:42 GMT

User count: 4071

Join the conversation at slack.cordova.io

Channel #general (29 messages)


Wed, 19 Aug 2020 11:05:37 GMT

@ivan.harpley says

If anyone is feeling generous, could you take a look at me question I just posted to SOF? I relates to playing video files stored locally on an ios device: https://stackoverflow.com/questions/63485567/playing-a-video-loaded-via-cdvfile-in-cordova

Wed, 19 Aug 2020 11:08:11 GMT

@ivan.harpley says

... even an upvote for visibility would help out LUL

Wed, 19 Aug 2020 11:10:34 GMT

@abul.asar22 says

Hello everyone, we are using facebook-sdk for analytics. We have used the javascript script for loading facebook-sdk in index.html for web app. But for android app we are going to use cordova-plugin-facebook4 . The script in index.html is loading for mobile app as well. Is it possible to restrict it for only for web app ? I suspect index.html script and cordova-plugin-facebook plugin will effect the analytics. thanks in advance

Wed, 19 Aug 2020 12:22:12 GMT

@akash.dhande says

Hello everyone, can you please suggest how can we hide copy/paste menu on text selection. I want to show custom button/action on text selection

Wed, 19 Aug 2020 13:18:39 GMT

@h.keskin says

Hello everyone, after updating to Cordova CLI 10.0.0 Android 9.0.0 access to the storage is not possible. Error Message cdvfile://localhost/files/sbsdk-plugin-storage/a5297cb7-103d-46c7-9d27-721e84f69fed.jpg net::ERR_UNKNOWN_URL_SCHEME . Can someone please help?

Wed, 19 Aug 2020 15:50:37 GMT

@khatridevk says

I am updating to cordova-ios@6.0.0, while platform add I get this error,cordova-custom-config: An error occurred during parsing of [ ..project.pbxproj ]... maybe you forgot to remove/add ios platform? not sure why is this showing ! Observations: After tracing [ a hook in custom-config plugin ], I see this error string being logged in applyCustomConfig.js file in method that parses the xcodeproject. However, same configuration works well with cordova-ios@4.3.1 Workaround I found is, run cordova prepare before platform add . But I cannot run prepare in prod environment, not able to connect dots on how to solve this.

Wed, 19 Aug 2020 15:50:54 GMT

@khatridevk says

Suggestions pls

Wed, 19 Aug 2020 18:45:46 GMT

@luca says

Hey All, I‘m having some performance trouble on both my ios and android apps. My app works smoothly on mobile browsers, but runs pretty laggy when wrapped with cordova. I’ve read in a few places that hardwareAcceleration could be the culprit, but (edit) haven‘t been able to try this as I’m not sure how. Anyone have any ideas or resources they could point me to?

Wed, 19 Aug 2020 19:00:50 GMT

@norman137 says

I‘m not sure about the hardware acceleration but it’s probably best to start off by using the performance audit tools the web inspector offers, which should help you understand exactly what part of your app is being slow.

Look for anything that seems abnormally large. If there is no one thing that is stands out (no excessive scripting time, no GC‘s etc...), ie if the webview is just idling for the most part, then this suggest the performance bottleneck is on the native side, which may be caused by a plugin. You’d have to use the native tools provided by Xcode, or android studio for auditing performance.

Wed, 19 Aug 2020 19:07:11 GMT

@luca says

Thanks @norman137, appreciate the help. Any resources you could point me to /recommend that talk about this process?

Wed, 19 Aug 2020 19:11:29 GMT

@norman137 says

https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/?utm_source=devtools

Pretty sure safari web inspector has the same tools, they just may work a little differently.

Wed, 19 Aug 2020 19:13:29 GMT

@norman137 says

So if there is something specific that is slow, like if you tap on a button and something about that button's click event is slow. This will help you identify exactly what is slow.

In the end, this should either help you identify the performance bottleneck in the web app, or you will rule out that the performance bottleneck is not in the webapp itself, but perhaps in the native land. Which means it's probably caused by a cordova plugin you have installed.

Wed, 19 Aug 2020 19:18:18 GMT

@luca says

Much appreciated. Will review! Thanks so much Norman.

Wed, 19 Aug 2020 19:41:33 GMT

@luca says

Wow! I think I may have found the culprit in the Cordova docs... “Many devices impose a 300ms delay on click events in order to distinguish between a tap and tap-to-zoom gesture” (https://cordova.apache.org/docs/en/latest/guide/next/)

Wed, 19 Aug 2020 19:45:14 GMT

@dpogue says

That shouldn't be an issue anymore on Android, or on iOS with WKWebView

Wed, 19 Aug 2020 19:47:17 GMT

@luca says

I‘m using just the stock WebView that comes with Cordova. Is it recommended to use WKWebView? (I’m new to cordova, so don't know all of the tricks).

Wed, 19 Aug 2020 19:49:07 GMT

@norman137 says

If you‘re using cordova-ios@6 (the latest release), you’re already on wkwebview.

Wed, 19 Aug 2020 19:51:50 GMT

@luca says

Oh, looks like i'm currently on 5.1.1

Wed, 19 Aug 2020 19:52:53 GMT

@norman137 says

for chrome on android will have the 300ms delay, unless if the html page contains a viewport meta tag.

e.g:

<meta name="viewport" content="width=device-width"> iOS wkwebview will also use the same behaviour I think, removing the 300ms delay if that viewport tag is present.

https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away

Wed, 19 Aug 2020 19:54:13 GMT

@norman137 says

5.1.1 by default uses UIWebView, so to use wkwebview, you need a plugin, such as cordova-plugin-wkwebview-engine. However updating to the latest version of cordova-ios would be preferrable, if possible.

Do note that Apple forces you to use wkwebview. If your app contains UIWebView references, the app will be rejected from their app store.

Wed, 19 Aug 2020 19:54:43 GMT

@luca says

Welp, I'm glad I came here then haha. Thanks.

Wed, 19 Aug 2020 19:54:51 GMT

@luca says

Is it best to just remove the platform and reinstall?

Wed, 19 Aug 2020 19:54:59 GMT

@norman137 says

yah

Wed, 19 Aug 2020 19:55:15 GMT

@norman137 says

cordova platform add ios@6```
should get you the latest version of `cordova-ios`

Wed, 19 Aug 2020 19:56:14 GMT

@norman137 says

If you're building a new app, you may consider configuring your app to use schemes as well... which is mentioned in this blog post.

https://cordova.apache.org/howto/2020/07/18/uiwebview-warning.html

Wed, 19 Aug 2020 20:03:09 GMT

@luca says

Upgraded, and the UI is nice and snappy!

Wed, 19 Aug 2020 20:03:21 GMT

@luca says

Thanks @norman137 and @dpogue

Wed, 19 Aug 2020 20:05:47 GMT

@norman137 says

:partyparrot:

Thu, 20 Aug 2020 04:16:25 GMT

@ifour.milan1 says

Hello everyone I am working on cordova app also i used kendotreeview for data select, but currently i have too much data on this dropdown list(parent node only)

so i have think to 20 records get each call when kendotreeview scroll (like endlessscroll + listview)

is it possible to get each 20 record each call using kendotreeview?

Thank you Milan

Channel #cordova-ios (1 messages)


Wed, 19 Aug 2020 15:52:36 GMT

@ivan.harpley says

When loading local files (video and images) into html elements (<video> and <img>) using cordova-ios 6.1.0 and window.WkWebView.convertFilePath([file path]), is there any additional properties I need to add to config.xml or my Content Security Policy? I‘ve added both a scheme and hostname and then added my scheme value into the CSP but I’m still getting Refused to load unsafe:<app://localhost/>... because it doesn't appear in the media-src directive of the Content Security Policy error... Does anyone have a working example of having this work?