Back to Cordova

2020 12 01

slack-digest/2020-12-01.md

latest10.1 KB
Original Source

Cordova Slack Digest

Tue, 01 Dec 2020 08:31:17 GMT

User count: 4252

Join the conversation at slack.cordova.io

Channel #general (46 messages)


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

https://github.com/apache/cordova-docs/issues/1004

Mon, 30 Nov 2020 16:30:49 GMT

@norman137 says

I believe the current logic is

  1. If &lt;plugin&gt; or &lt;engine&gt; tags exists on config.xml they will be "migrated" to package.json (but I don't think they are removed from config.xml).

Mon, 30 Nov 2020 16:32:02 GMT

@norman137 says

config.xml overrides package.json I 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 &lt;plugin&gt; and &lt;engine&gt; be deleted from config.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 WKWebView using 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.js is 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:cordova task

Mon, 30 Nov 2020 22:09:16 GMT

@norman137 says

The hello template will have a &lt;script src="cordova.js"&gt;&lt;/script&gt; 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 deviceready event.

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.js starts the loading process, but the loading process is asynchronous I believe, that's why there is a deviceready event.

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 deviceready event 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. 

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

chunkedMode is 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

Channel #cordova-ios (3 messages)


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.1 When using the command cordova run ios my 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

  1. check if you correct defined splashscreen config and not used manual closing the screen
  2. 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?

Channel #cordova-android (1 messages)


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