Cordova Slack Digest

Thu, 29 Apr 2021 08:22:52 GMT

User count: 4468

Join the conversation at slack.cordova.io

Channel #general (57 messages)


Wed, 28 Apr 2021 12:50:12 GMT

@leon.dudlik says

Hi there! Is it possible to mark certain APIs as deprecated in my own Cordova plugin?

Kind regards, Leon

Wed, 28 Apr 2021 12:52:10 GMT

@norman137 says

Generally that's done via JSDocs tags, and compatible editors can pick up on that and have a visual indicator (usually a strikeout) when an API is used: https://jsdoc.app/tags-deprecated.html

Wed, 28 Apr 2021 14:48:14 GMT

@veaceslav says

Hi guys

Wed, 28 Apr 2021 14:49:23 GMT

@veaceslav says

have a question. i'm trying to integrate cordova new relic plugin to the project but during the build get following error:

Wed, 28 Apr 2021 14:49:24 GMT

@veaceslav says

A problem occurred evaluating project ‘:app’. > Failed to apply plugin [id ‘newrelic’] > The New Relic plugin is not compatible with Android Gradle plugin version 3.3.0. AGP versions 3.4.0 - 4.3.0 are officially supported.

Wed, 28 Apr 2021 14:49:49 GMT

@veaceslav says

tried to set

Wed, 28 Apr 2021 14:49:50 GMT

@veaceslav says

<https://services.gradle.org/distributions/gradle-3.5-all.zip> ```


Wed, 28 Apr 2021 14:49:57 GMT

@veaceslav says

but didn't helped

Wed, 28 Apr 2021 14:50:11 GMT

@veaceslav says

if anyone can help with this

Wed, 28 Apr 2021 14:51:28 GMT

@jcesarmobile says

The plugin version and the wrapper version are different

Wed, 28 Apr 2021 14:52:27 GMT

@jcesarmobile says

The distribution url is for the wrapper, you should use 6.5 or greater

Wed, 28 Apr 2021 14:53:15 GMT

@jcesarmobile says

Latest plugin is 4.1.3

Wed, 28 Apr 2021 15:06:46 GMT

@veaceslav says

@jcesarmobile sorry i'm new to this and not quite clear. yes distribution ulr updates the wrapper gradle file with htis version. Not quite sure what i should do

Wed, 28 Apr 2021 15:15:06 GMT

@norman137 says

Looks like you‘re using an old version of cordova-android. The current latest stable currently uses AGP 4.0.0, but in your environment, it’s using 3.3.0

Version 3.3.0 was used in cordova-android@8, so you probably just need to upgrade your cordova-android.

cordova platform add android@9```
I'd advised using the latest cordova cli before upgrading as well.

Wed, 28 Apr 2021 15:16:37 GMT

@veaceslav says

@norman137 i'm using v 10.0.0

Wed, 28 Apr 2021 15:16:47 GMT

@veaceslav says

and i've tried this as well

Wed, 28 Apr 2021 15:17:11 GMT

@veaceslav says

adding android v9

Wed, 28 Apr 2021 15:17:26 GMT

@veaceslav says

but when i start build it reverts it to 8.1

Wed, 28 Apr 2021 15:17:34 GMT

@veaceslav says

and i have no idea why

Wed, 28 Apr 2021 15:18:00 GMT

@norman137 says

Sounds like you might have maybe an engine entry in your config.xml or perhaps package.json that tells cordova to use 8.1 instead of 9.1

Wed, 28 Apr 2021 15:18:31 GMT

@veaceslav says

package.json is overriten during the build

Wed, 28 Apr 2021 15:19:45 GMT

@veaceslav says

i updated config xml with

Wed, 28 Apr 2021 15:19:46 GMT

@veaceslav says

<engine name=“android” spec=“9.0.0” />

Wed, 28 Apr 2021 15:19:53 GMT

@veaceslav says

but it doesn't help

Wed, 28 Apr 2021 15:20:32 GMT

@veaceslav says

it's so weird

Wed, 28 Apr 2021 15:20:39 GMT

@veaceslav says

i'm out of ideas

Wed, 28 Apr 2021 15:22:55 GMT

@veaceslav says

could it be this argument in build command ?

Wed, 28 Apr 2021 15:22:56 GMT

@veaceslav says

--gradleArg=-PcdvCompileSdkVersion=29'

Wed, 28 Apr 2021 15:23:38 GMT

@veaceslav says

just checked the grunt file where the build is happening

Wed, 28 Apr 2021 15:27:03 GMT

@norman137 says

Yah it is weird... I'd try resetting your environment.

Note: If you have any custom modifications inside your platforms/ folder, you'll lose them.

The engine node in the xml shouldn‘t be required anymore with the latest CLI, but it’s suppose to read it for backwards compatibility. I'd simplify your environment by removing it.

cordova-android@9 targets/compiles against 29 by default, so that gradleArg is redundant on cordova-android@9.

Confirm that cordova is actually using v10 (via cordova -v)

I'd also try deleting:

  • node_modules
  • package-lock.json
  • platforms
  • plugins

then run the following:

cordova platform add android
cordova build android```

Wed, 28 Apr 2021 16:55:22 GMT

@veaceslav says

@norman137 ok the steps seems helped to resolve the issue with versions

Wed, 28 Apr 2021 16:55:36 GMT

@veaceslav says

but now i have other errors during compilation

Wed, 28 Apr 2021 16:55:37 GMT

@veaceslav says

> Task :app:compileDebugJavaWithJavac FAILED /Users/veaceslavbotnaru/Project/mobile/cordova/platforms/android/app/src/main/java/com/newrelic/cordova/plugin/NewRelicCordovaPlugin.java:15: error: cannot find symbol import com.newrelic.agent.android.ApplicationPlatform; ^ symbol: class ApplicationPlatform location: package com.newrelic.agent.android /Users/veaceslavbotnaru/Project/mobile/cordova/platforms/android/app/src/main/java/com/newrelic/cordova/plugin/NewRelicCordovaPlugin.java:17: error: cannot find symbol import com.newrelic.agent.android.analytics.AnalyticAttribute; ^ symbol: class AnalyticAttribute location: package com.newrelic.agent.android.analytics /Users/veaceslavbotnaru/Project/mobile/cordova/platforms/android/app/src/main/java/com/newrelic/cordova/plugin/NewRelicCordovaPlugin.java:47: error: cannot find symbol devInfo.setApplicationPlatform(ApplicationPlatform.Cordova); ^ symbol: variable ApplicationPlatform location: class NewRelicCordovaPlugin /Users/veaceslavbotnaru/Project/mobile/cordova/platforms/android/app/src/main/java/com/newrelic/cordova/plugin/NewRelicCordovaPlugin.java:48: error: cannot find symbol devInfo.setApplicationPlatformVersion(pluginVersion); ^ symbol: method setApplicationPlatformVersion(String) location: variable devInfo of type DeviceInformation /Users/veaceslavbotnaru/Project/mobile/cordova/platforms/android/app/src/main/java/com/newrelic/cordova/plugin/NewRelicCordovaPlugin.java:50: error: cannot find symbol NewRelic.setAttribute(AnalyticAttribute.APPLICATION_PLATFORM_VERSION_ATTRIBUTE, pluginVersion); ^ symbol: variable AnalyticAttribute location: class NewRelicCordovaPlugin Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Wed, 28 Apr 2021 16:56:17 GMT

@veaceslav says

looks like new relic cant find some classes

Wed, 28 Apr 2021 16:56:42 GMT

@norman137 says

Yah, that sounds like a plugin issue, not sure how much help I can be here.

Wed, 28 Apr 2021 16:57:22 GMT

@veaceslav says

@norman137 ok thanks anyway you already helped a lot

Wed, 28 Apr 2021 16:58:58 GMT

@norman137 says

lookslike something is misconfigured on the plugin side... since it looks like it's placing java classes in a src/main/java/com/newrelic/cordova/plugin folder... but based on import packages, it probably should be src/main/java/com/newrelic/

That stuff is controlled via it's plugin.xml file

Wed, 28 Apr 2021 16:59:50 GMT

@veaceslav says

hm let me check it

Wed, 28 Apr 2021 17:01:50 GMT

@veaceslav says

yah you right it's inside xml

Wed, 28 Apr 2021 17:01:52 GMT

@veaceslav says

Wed, 28 Apr 2021 17:10:26 GMT

@norman137 says

If you fork the plugin and correct the target-dir it may just work... I'm guessing

Wed, 28 Apr 2021 18:20:45 GMT

@andrew867 says

Is there a way to control browser engine flags via config.xml

Wed, 28 Apr 2021 18:25:10 GMT

@andrew867 says

I’m trying to locate the initialisation of the engine in the sources of the windows platform. TBH, would love to where it’s initialised in the sources of any platform atm!

Wed, 28 Apr 2021 18:36:23 GMT

@norman137 says

@andrew867 afaik none of that is exposed through config.xml settings. You may need to fork the platform -- if there is a native way of configuring those flags.

Wed, 28 Apr 2021 18:39:09 GMT

@andrew867 says

Thanks dude, I’d kinda thought that which is why I’ve been looking through the sources to see where the browser is initialised.

When building an app for Windows the TOUCH_EVENTS flag appears to not be enabled - https://trac.webkit.org/wiki/FeatureFlags#TOUCH_EVENTS

Wed, 28 Apr 2021 18:42:16 GMT

@andrew867 says

I’ve been able to wrap around it using the PointerEvent . However, it’s not as smooth as the identical code is running in a browser in the same device. Others - iOS / Android - are smooth.

Wed, 28 Apr 2021 18:43:30 GMT

@andrew867 says

I’ve got a test case, I’ll create a bug report on gh, just wanted to fix it and send a pr at the same time.

Wed, 28 Apr 2021 18:57:18 GMT

@dpogue says

Those FeatureFlags you linked are compile-time flags for the WebKit engine used by iOS and macOS, not runtime flags and they don't have any bearing on the webview used by Windows

Wed, 28 Apr 2021 18:57:40 GMT

@dpogue says

TouchEvents are semi-deprecated (although fairly widely supported) in favour of PointerEvents

Wed, 28 Apr 2021 19:00:03 GMT

@andrew867 says

Which WebView is used by windows?

Wed, 28 Apr 2021 19:00:52 GMT

@andrew867 says

Ahem, why didn’t think to check PointerEvents on the other platforms. 🙂 thanks for pointer.

Wed, 28 Apr 2021 19:02:33 GMT

@dpogue says

cordova-windows probably uses MSEdgeHTML (the old Edge webview)

Wed, 28 Apr 2021 19:03:25 GMT

@andrew867 says

Yeah, I think I’d assumed that it was already ported to the new Edge engine.

Wed, 28 Apr 2021 19:03:55 GMT

@dpogue says

It might be, I‘m not actually sure (I’ve never run cordova-windows 🙊)

Wed, 28 Apr 2021 19:05:06 GMT

@andrew867 says

One thing that stalled me using PointerEvent over TouchEvents was identifying the array of active pointers. I’ve created a keyed array to track them for side-setting the touch issue atm.

Wed, 28 Apr 2021 19:05:57 GMT

@andrew867 says

Is there a property that includes the active pointers on the PointerEvent? I couldn’t see it here : https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent

Wed, 28 Apr 2021 19:10:27 GMT

@andrew867 says

What I ended up doing was a making a polyfill to manage the stack of pointers and dispatching touch events from the pointer events. I thought it was feeling laggy…

TBH - I think I’ve been looking at it too long. The difference is hardly noticeable, I was playing and thought I was using the browser (Edge / Chrome) but it wasn’t it was cordova. Cool beans.

Channel #cordova-ios (26 messages)


Wed, 28 Apr 2021 15:22:36 GMT

@mattwenner1 says

Does anyone support Google SSO in their app? I have for quite some time now and am using omniauth on my backend. When clicking “Sign in with Google” I launch an external browser that then redirects to google and back. This had been working well for quite some time. However I’ve noticed that my newer builds of my app now break when Safari is the default browser.

Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected

Just wondering if anyone ran into this lately or had better ways to handle SSO?

Wed, 28 Apr 2021 15:42:22 GMT

@alex678 says

Hello everybody 😉 I have problem since (it seems) last version of iOS. I use cordova with html input “time”, and now times are displayed with AM/PM, even for French users.

Wed, 28 Apr 2021 15:48:04 GMT

@dpogue says

Time inputs are an iOS system thing, Cordova can't control how they work

Wed, 28 Apr 2021 15:52:06 GMT

@alex678 says

The problem occurs since iOS 14.5 ,

Wed, 28 Apr 2021 15:52:20 GMT

@alex678 says

there is any release note or other ? Or way to “change” this ?

Wed, 28 Apr 2021 15:53:19 GMT

@dpogue says

Apple definitely made some changes to time pickers in iOS 14.5 (including fixing an awful scrolling bug), but I don‘t think it’s called out in release notes. There's no way to change it that I know of

Wed, 28 Apr 2021 15:54:40 GMT

@alex678 says

ok thx

Wed, 28 Apr 2021 16:11:01 GMT

@jcesarmobile says

Do French people don’t use am/pm?

Wed, 28 Apr 2021 16:12:43 GMT

@jcesarmobile says

Does your app support French Some native UIs are localized, but by default all cordova apps are English only, you have to add the supported languages in the info.plist

Wed, 28 Apr 2021 16:16:31 GMT

@alex678 says

Haaa, i don't know 😉 Thanks for you info ! I will check. in all case, only “input html time” are concerned.

Wed, 28 Apr 2021 16:17:27 GMT

@alex678 says

and french user never use am/pm

Wed, 28 Apr 2021 16:20:51 GMT

@alex678 says

I have French in the plist, and i also set default locale = France instead of USA, but i always have AM/PM

Wed, 28 Apr 2021 16:30:39 GMT

@dpogue says

I suspect the time pickers will use whatever the system language is, regardless of what your app language is

Wed, 28 Apr 2021 16:34:05 GMT

@alex678 says

yes but i have French language

Wed, 28 Apr 2021 16:34:08 GMT

@alex678 says

on iPhone

Wed, 28 Apr 2021 16:34:27 GMT

@alex678 says

my goal is to use the system language, of course. but now each picker has AM/PM.

Wed, 28 Apr 2021 16:35:42 GMT

@dpogue says

I would file a bug with Apple

Wed, 28 Apr 2021 17:54:28 GMT

@jcesarmobile says

Yeah, Apple probably doesn’t know French people don’t use am/pm

Wed, 28 Apr 2021 18:10:33 GMT

@alex678 says

I'm testing this, input “time” changed to “text” readonly, then on click i will display a popup to choose Hour. not the best solution of course, but i have too many complaints

Wed, 28 Apr 2021 18:11:35 GMT

@alex678 says

I had already the same problem with “Duration time”, because USA user want to set for example 23:00 duration, not a duration of 11 PM.

Wed, 28 Apr 2021 18:13:44 GMT

@norman137 says

Did you change the region as well as the language?

On the iOS simulator, if I change hte language, it shows example region formats, and it still shows AM/PM format.

But if I changed the Region to France, then it looks like I get the proper format..

Wed, 28 Apr 2021 18:13:57 GMT

@norman137 says

Although I'm testing this on iOS 14.1 and not in the webview

Wed, 28 Apr 2021 18:33:25 GMT

@alex678 says

multiple users with France/French have the same problem, and with iOS 14.5 same for me, i tested

Wed, 28 Apr 2021 18:33:36 GMT

@alex678 says

it only occurs with “input time”

Wed, 28 Apr 2021 18:36:08 GMT

@alex678 says

i tested with real iPhone 6 Plus.

Wed, 28 Apr 2021 18:36:26 GMT

@alex678 says

worked perfectly on iOS 14.4, but wrongly in 14.5 with the same app version

Channel #cordova-android (3 messages)


Wed, 28 Apr 2021 11:45:39 GMT

@ara says

I am using Cordova plugin to display an internal link (file:///android_asset/www/index.html that hosts webrtc streaming) as opposed to external link using https. Is the Https also applicable for the internal link, or is that protocol not applicable since it is internal link?

Wed, 28 Apr 2021 14:06:40 GMT

@jcesarmobile says

Pretty sure cordova-android doesn’t support webrtc, doesn’t matter if you use https or file, unless you use some plugin that adds support

Thu, 29 Apr 2021 04:05:09 GMT

@abhishekkumar619z says

Does anyone know how to make accessibility service work in android? I have a stackoverflow question posted https://stackoverflow.com/questions/67224206/accessibility-service-not-showing-up-android-cordova|here Please let me know if you can help me solve it.