Cordova Slack Digest

Fri, 01 Oct 2021 08:21:06 GMT

User count: 4637

Join the conversation at slack.cordova.io

Channel #general (11 messages)


Thu, 30 Sep 2021 08:24:20 GMT

@dpogue says

cordova-android pulls in androidx.appcompat:appcompat:1.3.1 (version can be overridden in config.xml with a preference, but default is 1.3.1)

Thu, 30 Sep 2021 08:25:12 GMT

@dpogue says

https://github.com/apache/cordova-android/blob/05e3e3cf8dcceb17aff945328ecd60ad69c43dc2/templates/project/app/build.gradle#L289 https://github.com/apache/cordova-android/blob/05e3e3cf8dcceb17aff945328ecd60ad69c43dc2/framework/build.gradle#L79 https://github.com/apache/cordova-android/blob/05e3e3cf8dcceb17aff945328ecd60ad69c43dc2/framework/cdv-gradle-config-defaults.json#L8

Thu, 30 Sep 2021 08:34:10 GMT

@chris.khong says

Yes I don’t know how gradle fetched the new beta version…

Thu, 30 Sep 2021 09:10:35 GMT

@miroslav.vojtus says

Hello all. Do you have please a suggestion how to properly implemennt main process to web notifications with the newest cordova-electron plugin system? I learned it is possible to perfrom cordova.exec but I do not know how to do a observer pattern where web observes events from a cordova-electron plugin. I guess there is no such a support yet and I have to override cdv-electron-preload.js with some ipc + cordova/channel. Am I on a right path?

Thu, 30 Sep 2021 09:37:15 GMT

@costagauci says

Hi, can anyone recommend an API for reading photos and videos from iPhone and Android devices? I‘ve tried cordova-plugin-photo-library however that does not work with videos and takes a long time to load if there are a lot of files on a device. I’ve also tried cordova-gallery-api however that returns an SQLITE_ERROR and has not been updated in 7 years.

Thu, 30 Sep 2021 11:53:34 GMT

@hilah1999 says

Hey, is there anyone here who have installed a Facebook app events code in his app development?

Thu, 30 Sep 2021 11:53:36 GMT

@hilah1999 says

Or is there anyone here who knows how to add Facebook events to the app?

Thu, 30 Sep 2021 11:53:40 GMT

@hilah1999 says

Please

Thu, 30 Sep 2021 23:03:31 GMT

@mcsd says

[ISSUE] I have a project in Sencha ExtJS 7.1.0.46 under the “modern toolkit” … so when I build the app I use “Apache Cordova” to convert my SPA app (html/css/js) to iOS native app … everything it’s 🆗 … but when I emulate the app in the XCode Simulator and run my App, when I execute an Ajax call to my backend API rest service at “https://localhost:5001” appears me an error like so or even if I make calls to our remote APIs domain…

Please help me in what I need to do … I will appreciate your help …

Thu, 30 Sep 2021 23:26:33 GMT

@norman137 says

“Access control” checks refers to the CORS protocol. Your server is not responding properly.

Your server should respond with Access-Control-Allow-Origin header.

The preflight response error is related to your server not correctly responding to the OPTIONS request variant of your API. For every API request you do, your server should also respond to the OPTIONS method variant of that API. The OPTIONS variant should respond with no body (e.g. it should have Content-Length: 0, and it should also have Access-Control headers defined. Particarly Access-Control-Allow-Origin, but you can also declare Access-Control-Allow-Headers and Access-Control-Allow-Methods.

Access-Control-Allow-Origin should be 1 value, either a domain or a wilcard *. In my experience however, older iOS devices didn‘t respond to wildcard correctly, so you may want to dynamically read the request’s Origin header and set the Access-Control-Allow-Origin dynamically as a work-around for wildcard.

Access-Control-Allow-Methods is a comma delimited of HTTP methods allowable, etc: GET, POST, OPTIONS -- note OPTIONS is required to support preflight requests. Access-Control-Allow-Headers is a comma delimited list of acceptable HTTP headers.

I have a blog post that goes into much more detail: https://breautek.com/articles/enabling-cors.html

Thu, 30 Sep 2021 23:27:56 GMT

@norman137 says

CORS is a browser security concept. It‘s implementation in the context of native app WebViews imo doesn’t make sense, which is why it's confusing. But there is no API to disable it.

Channel #cordova-android (2 messages)


Thu, 30 Sep 2021 08:31:39 GMT

@ucheozoemena says

Okay thanks Norman. My builds are done on a CI system so I'm not able to search that folder easily. I tried setting the implementation to 1.3.0 using the before_build hook:

  dependencies {
    // Add this line
    implementation 'androidx.appcompat:appcompat:1.3.0'
  }
}```
 but now I'm getting this error:
> Could not find method implementation() for arguments [[REDACTED]x.appcompat:appcompat:1.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Any ideas as to what could be causing this? Seems like I didn't format the changes correctly.

Thu, 30 Sep 2021 17:49:08 GMT

@ucheozoemena says

Hey folks,

I get a 401 error when I try to download images using the file-transfer plugin. My server doesn‘t return a 401 status at all, so it’s not an issue with authentication on my server. I tracked down the code that's generating the 401 status to this <https://github.com/apache/cordova-plugin-file-transfer/blob/ec11d2fd0e87d7d9e0ba94b1989ffb71af1c3c96/src/android/FileTransfer.java#L698|line of code> that sends the 401 status if the url is not in the allow list for the app. The problem is that the url should match because its base is in the allow list. I have set the allow list to allow both full and wildcard matching of the base url, yet this problem continues to happen. These are my access tags for the base url:

    &lt;access origin="https://*.dev.textras.com/*" /&gt;
    &lt;access origin="https://*.textras.com/*" /&gt;```
And an example of an image url that's not getting downloaded is `<https://cloud.dev.textras.com/v1/media/round?r=32&amp;q=100&amp;f=images/6151be6d02dbc700142308af/thumbnail.jpeg>`. The image loads correctly in an `img` tag and in the browser.