Back to Cordova

2021 09 29

slack-digest/2021-09-29.md

latest7.2 KB
Original Source

Cordova Slack Digest

Wed, 29 Sep 2021 08:21:06 GMT

User count: 4634

Join the conversation at slack.cordova.io

Channel #general (11 messages)


Tue, 28 Sep 2021 13:24:39 GMT

@harel.mazor says

I'm experiencing an issue with cordova and npm 7. I'm also experiencing other issues with npm 7 related to fetching of github repos (as often needed with cordova plugins). I've reverted to npm 6. Am I the only one experiencing these issues? From cordova side it seems to ignore some plugins I use and from npm side it fails in CI due to bad integrity value. Are the current recommendation from Cordova side is to keep using version 6 of npm?

Tue, 28 Sep 2021 13:28:22 GMT

@norman137 says

You might have to reinstall cordova -- there was a patch that was released some time ago to fix issues with NPM 7 -- not sure if that is what you were experiencing though.

Tue, 28 Sep 2021 19:31:16 GMT

@harel.mazor says

I've managed to upgrade everything to cordova-android 10 and androidX (Yay!). In the release notes I saw the part about app data getting lost due to breaking changes. I saw the flag that allows reverting this change and it seems to work as expected. I have two questions:

  1. Will this flag be disabled sometime in the future - i.e. is this a temporary solution or is it a long term solution?
  2. Is there an easy way (or documented way) to migrate the data? I'm saving the app state in indexDB using dexie. I have no way to know when the user will update the app. where can I save data in order to migrate it? Do I need to upload all the users data to the server now to allow this migration? Using the file system in android 10+ is problematic as you know. I'm honestly not sure how to handle this. Most of the data is not really stored locally, but doing this upgrade I'll need all my users to login again, download a lot of stuff that's already cached on their devices, it's not impossible, but it's also not a great user experience.

Tue, 28 Sep 2021 19:35:40 GMT

@dpogue says

  1. The flag will be there for the foreseeable future, but Google has introduced more and more restrictions of file URL content in newer SDK versions, so functionality might end up breaking in future Android versions.
  2. There was a long discussion about this issue on the mailing list, and the ultimate conclusion is that each app needs to evaluate if/how to migrate its data. Cordova can't do a 1-size-fits-all solution because different apps have different requirements and data structures. If you can re-create your data by having your users login again, that is probably the simplest solution. Migrating the data itself is a bit tricky and involves a plugin to copy LevelDB files around on the device filesystem, and trying to get them in the correct spot before the webview loads, and you need to deal with failure cases and not overwriting new data and stuff like that πŸ˜•

Tue, 28 Sep 2021 19:50:26 GMT

@norman137 says

Not just leveldb... if the device happens to be using webview < 78 or 79 ... the webview uses sqlite databases instead.

Tue, 28 Sep 2021 19:50:53 GMT

@norman137 says

so some devices you may have to migrate from sqlite databases, other devices might be leveldb

Tue, 28 Sep 2021 19:54:47 GMT

@dpogue says

ooh, a world of pain that contains multiple worlds of pain within it πŸ˜…

Tue, 28 Sep 2021 20:19:31 GMT

@harel.mazor says

Most of the data will be downloaded upon login. It's just might take about 5-15 minutes for a user to get all the data he had before the upgrade. The app is intended for offline usage (maps, points of interest, routes), so if this happens just before you go offline it's bad. But I understand there's no easy solution or one that will help all. Thanks again for the fast response and detailed answers!

Tue, 28 Sep 2021 20:31:35 GMT

@norman137 says

I have something similar requirements... Our apps display maps and it has a network of roads for users where they manage conditions of roads -- and it has offline capability, since the user doesn't always have an internet connection when out on the field, especially in rural areas.

Since UIWebView -> WKWebView migration, we started moving all storage away from browser-based storage so that we are in more control over the data. Generally we rely on SQlite instead using a cordova plugin, but depending on the complexity of the dataset, flat json files sometimes works as well.

Tue, 28 Sep 2021 20:32:31 GMT

@norman137 says

There's a lot of issues with the cordova-plugin-file plugin but virtually all of those issues are related to external storage... so if you just stick within internal storage you'll be fine.

Tue, 28 Sep 2021 20:38:03 GMT

@harel.mazor says

Yea, I agree, but I'm also writing a site that uses the same infrastructure, using sqlite in a website is not possible. Sure, I can abstract the DAL layer and use stuff differently in web browser and app, but testing in the browser is a lot easier than testing on a device (for me at least) πŸ™‚ and the more common code I use the lest tests I need to do, in theory...

Channel #cordova-android (2 messages)


Tue, 28 Sep 2021 09:32:39 GMT

@info300 says

Hallo guys! I need urgent help!!!!!!!

after uninstall whitelist plugin and upgrading cordova-android to v10.1.1 I can’t connect to my server.

in the logs I see W/SystemWebViewClient: URL blocked by whitelist: <https://mysite.com>

what I missed?

Tue, 28 Sep 2021 14:23:43 GMT

@prasunjajodia says

Hi guys.. For reasons other than the google play store, I need a release app to be in apk in [email protected] I tried cordova build android --packageType=apk --release But it still produced an aab file and not an apk file. Any suggestions?

Channel #cordova-ios (5 messages)


Tue, 28 Sep 2021 08:31:15 GMT

@jakob.pfab says

on iOS 15 i have some issues playing audio files. After playing maybe 50 audios files or something i dont have any more sound output. Memory usage is normal (about 30mb). Any ideas?

Tue, 28 Sep 2021 08:31:39 GMT

@jakob.pfab says

restarting the app fixes it

Tue, 28 Sep 2021 08:32:38 GMT

@jakob.pfab says

while the audio still works i get this error in the Xcode Output

[ProcessSuspension] 0x1031bd450 - ProcessAssertion: Failed to acquire RBS assertion 'WebKit Media Playback' for process with PID=5412, error: Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}

Tue, 28 Sep 2021 08:36:09 GMT

@jakob.pfab says

audios are played via javascript (HTML5 audio element created with

new
...
audio.play();```

Tue, 28 Sep 2021 12:33:57 GMT

@lkvh says

So I've reworked our entire application to use CORS and enabled the CORSFilter on all servers - only to realise safari blocks session cookies and I can't use withCredentials? FFS