slack-digest/2020-12-01.md
Tue, 01 Dec 2020 08:31:17 GMT
Join the conversation at slack.cordova.io
Mon, 30 Nov 2020 16:06:06 GMT
@jacobsgur says
Now that plugins are canonically defined in package.json, what can we safely remove from config.xml in order to clean it up? Can we delete all <plugin> elements? Anything else? e.g., <engine>?
Mon, 30 Nov 2020 16:07:44 GMT
@jacobsgur says
Mon, 30 Nov 2020 16:30:49 GMT
@norman137 says
I believe the current logic is
If
<plugin>or<engine>tags exists onconfig.xmlthey will be "migrated" topackage.json(but I don't think they are removed fromconfig.xml).
Mon, 30 Nov 2020 16:32:02 GMT
@norman137 says
config.xmloverridespackage.jsonI think if there are conflicts... may want to test to be sure.
Mon, 30 Nov 2020 18:38:51 GMT
@jacobsgur says
Thanks. So in order to clean up cruft, can
<plugin>and<engine>be deleted fromconfig.xml?
Mon, 30 Nov 2020 19:16:55 GMT
@khatridevk says
Seeing empty white spaces when I scroll a page with some heavy data [ table, images, some formatted text etc ] in html controls. iOS app is built using
[email protected]. Does WKWebView has any issue in rendering heavy content !
Mon, 30 Nov 2020 19:21:33 GMT
@norman137 says
I have an app that potentially has to list several thousands of records which it does no problem on
WKWebViewusing a virtualized list strategy.
Mon, 30 Nov 2020 21:41:13 GMT
@chadwick.blackford says
@norman137 /@niklasmerz hallo guys! I need quick answer… do cordova loading all plugins before html use my app scripts?
Mon, 30 Nov 2020 21:42:27 GMT
@chadwick.blackford says
we have found one bug in our legacy code , where 5yers ago someone wrote service like cordov-dialogs.. and now we installed cordova-dialog plugins and nothing work 🙂
Mon, 30 Nov 2020 21:43:16 GMT
@chadwick.blackford says
may I say that cordova stuff ALWAYS loaded and initialized first as a normal app code (react, angular, etc)
Mon, 30 Nov 2020 22:06:56 GMT
@norman137 says
depends on the order of your scripts...
cordova.jsis responsible for beginning the loading process of the plugins.
Mon, 30 Nov 2020 22:07:45 GMT
@chadwick.blackford says
@norman137 I have this ordering
Mon, 30 Nov 2020 22:09:14 GMT
@chadwick.blackford says
cordova js will be injected only during app build in
build:cordovatask
Mon, 30 Nov 2020 22:09:16 GMT
@norman137 says
The hello template will have a
<script src="cordova.js"></script>line, this file is generated by the platform. I don't see the equivalent in your environment.
Mon, 30 Nov 2020 22:09:44 GMT
@chadwick.blackford says
we use html-replace plugin to skip adding cordova.js for web apps
in normal android /ios apps we have this list of scripts
Mon, 30 Nov 2020 22:12:17 GMT
@chadwick.blackford says
Mon, 30 Nov 2020 22:16:30 GMT
@norman137 says
I see
Mon, 30 Nov 2020 22:16:52 GMT
@norman137 says
I think in my applications I generally only start loading in (or at least executing the code) in the
devicereadyevent.
Mon, 30 Nov 2020 22:17:06 GMT
@chadwick.blackford says
this is correct
Mon, 30 Nov 2020 22:17:27 GMT
@chadwick.blackford says
we do the same bootstraping angular app
Mon, 30 Nov 2020 22:18:07 GMT
@norman137 says
Sorry -- what's the issue again?
Mon, 30 Nov 2020 22:18:45 GMT
@chadwick.blackford says
)
Mon, 30 Nov 2020 22:19:45 GMT
@chadwick.blackford says
in app.js there is one service with many navigator.notification.<myFunctions> overrriden functions..
Mon, 30 Nov 2020 22:20:04 GMT
@chadwick.blackford says
early we didn’t have cordova-dialogs pluing
Mon, 30 Nov 2020 22:20:09 GMT
@chadwick.blackford says
now, yes…
Mon, 30 Nov 2020 22:21:06 GMT
@chadwick.blackford says
@norman137 my question is - is 100% that cordova tuff and cordova plugins starter early as my app.js.. and my service will work fine.. or cordova dialogs plugin ovverride my app.js service with own implementation
Mon, 30 Nov 2020 22:25:01 GMT
@norman137 says
I see, so there's a conflict where the plugin clobbers something that your app already provides an implementation for.
cordova.jsstarts the loading process, but the loading process is asynchronous I believe, that's why there is adevicereadyevent.But if there is a conflict and you replace the object that the plugin is setting, chances are you'll break the plugin however.
Mon, 30 Nov 2020 22:25:51 GMT
@norman137 says
I believe once the
devicereadyevent fires... then all clobbering is done (because the plugins would have considered loaded)
Mon, 30 Nov 2020 22:26:05 GMT
@chadwick.blackford says
ok! thank you!
Mon, 30 Nov 2020 23:12:22 GMT
@raitomakesgames says
Will be ok if I ask some questions here?
Mon, 30 Nov 2020 23:20:34 GMT
@jcesarmobile says
Yeah, you can make a question per day, so come back tomorrow as today’s question was if you could ask questions
Mon, 30 Nov 2020 23:21:47 GMT
@jcesarmobile says
Just kidding, of course you can ask questions, but answers are not guaranteed
Mon, 30 Nov 2020 23:22:21 GMT
@raitomakesgames says
Thanks. I will post my question here 🙂
Mon, 30 Nov 2020 23:31:36 GMT
@raitomakesgames says
Does anyone have experience with large file uploads? We are using AWS S3. I have been trying a few methods to upload and none works.
- Uploading using the method from here https://clockwise.software/blog/dealing-with-large-files-in-cordova/ - instead of assembling the final blob, each chunk is sent to S3. Works well on small files. On large files 1.5GB to 5GB the file is uploaded 10-20% and the app close.
- https://github.com/apache/cordova-plugin-file-transfer - works well on small files, on large files we get
"code":3error. chunkedMode is set to false.- We also tried the fix from here with no success https://stackoverflow.com/questions/54946864/out-of-memory-error-when-calling-readasarraybuffer-method-on-filereader-of-the-c Thanks!
Mon, 30 Nov 2020 23:41:55 GMT
@norman137 says
Error 3 signals a connection error - https://github.com/apache/cordova-plugin-file-transfer/blob/master/www/FileTransferError.js#L37
the native syslogs might tell you more on that error (
adb logcat) for android, or the xcode logs for ios (with the debugger attached)
Mon, 30 Nov 2020 23:43:16 GMT
@raitomakesgames says
The error happens just when i'm trying to upload large files. If we upload 10-30mb files we don't get the error and the upload is success
Mon, 30 Nov 2020 23:44:08 GMT
@norman137 says
The described behaviour does sound like memory issues, but viewing the native logs should confirm it.
Mon, 30 Nov 2020 23:47:53 GMT
@raitomakesgames says
Do you know any methods for uploading large files? Before we were using crosswalk and instead of using the camera plugin we use the HTML5 file input. We were able to upload and record using the file input. The crosswalk is not supported on Android 10
Mon, 30 Nov 2020 23:56:07 GMT
@norman137 says
No, our apps use file transfer plugin, because we hit memory issues with out files but we are talking 50-100mb... not 5gb
Tue, 01 Dec 2020 00:00:08 GMT
@raitomakesgames says
Thanks
Tue, 01 Dec 2020 00:01:19 GMT
@norman137 says
File transfer plugin helps in my case because it helps keep the files outside of the webview environment. Transferring data, especially binary data across the cordova bridge (between the webview and the native land) is extremely inefficient. Base64 encoding is required and that blows up the size of the data by about 40%, when dealing with binary data.
File transfer plugin avoids those bottlenecks by doing the download/upload and the file reading/writing completely on the native side. But I have never used it on a large transfer like what you have. Like I said, 50-100mb max. But I'm pretty sure the plugin uses chunking/streams so I'm still kinda surprised to see high memory footprint if you are running into memory constraints
Tue, 01 Dec 2020 00:03:05 GMT
@raitomakesgames says
chunkedModeis set to false in the options
Tue, 01 Dec 2020 00:07:27 GMT
@raitomakesgames says
I'm not sure exactly how to upload to S3 using chunkedMode
Tue, 01 Dec 2020 01:00:13 GMT
@jcesarmobile says
You can use input file despite you don’t use crosswalk
Tue, 01 Dec 2020 01:00:30 GMT
@jcesarmobile says
It doesn’t show the camera, but shows a file picker
Tue, 01 Dec 2020 05:11:46 GMT
@joel640 says
Anyone using this fork? looks good! https://github.com/havesource/cordova-plugin-push
Mon, 30 Nov 2020 21:37:26 GMT
@cobimoos100 says
Hey folks, Cordova noob here. I'm using Cordova 10 and
cordova-ios 6.1.1When using the commandcordova run iosmy build is good and an emulator launches. However, when my app starts it stays frozen at the splash screen and no errors are outputted. Any advice would be greatly appreciated. I've spent hours trying to understand what's going on
Mon, 30 Nov 2020 21:40:14 GMT
@chadwick.blackford says
@cobimoos100
- check if you correct defined splashscreen config and not used manual closing the screen
- reinstall platform again (del+add)
Mon, 30 Nov 2020 21:41:29 GMT
@cobimoos100 says
Thanks @chadwick.blackford for the quick response. How would I go about step 1?
Mon, 30 Nov 2020 09:53:16 GMT
@bavaravac says
Hello image always save in portrait mode using camera plugin https://cordova.apache.org/docs/en/1.8.1/cordova/camera/camera.getPicture.html
can you please suggest how to save image in Landscape which is capture in Landscape mode?
Thank you