Wed, 19 Oct 2022 08:23:29 GMT
Join the conversation at slack.cordova.io
Tue, 18 Oct 2022 13:16:54 GMT
@ulimetic says
Hi!
Tue, 18 Oct 2022 13:17:08 GMT
@ulimetic says
I'm looking to get access to WKWebViewConfiguration from a plugin in Swift
Tue, 18 Oct 2022 13:17:35 GMT
@ulimetic says
Can anybody point me in the right direction ?
Tue, 18 Oct 2022 13:18:31 GMT
@ulimetic says
Need it so I can have access to websiteDataStore
Tue, 18 Oct 2022 13:56:43 GMT
@ulimetic says
Also, what is the status of https://github.com/apache/cordova-ios/pull/1157
Tue, 18 Oct 2022 13:57:03 GMT
@ulimetic says
This been waiting to be merge for like 2 years now ?
Tue, 18 Oct 2022 13:57:29 GMT
@ulimetic says
Same problem, solution provided, no merging, why ?
Tue, 18 Oct 2022 13:57:52 GMT
@norman137 says
It's also been marked as a draft, so likely was never a complete solution
Tue, 18 Oct 2022 13:58:49 GMT
@ulimetic says
Yea but then
Tue, 18 Oct 2022 13:58:50 GMT
@ulimetic says
https://github.com/apache/cordova-ios/pull/1157#issuecomment-932809577
Tue, 18 Oct 2022 13:59:09 GMT
@ulimetic says
“The
CDVWebViewEngineConfigurationDelegate
work has already been merged to master, and the extra commits make it quite hard to see what the actual change is here.”
Tue, 18 Oct 2022 13:59:57 GMT
@ulimetic says
Just trying to figure out what's implemented already
Tue, 18 Oct 2022 14:00:49 GMT
@ulimetic says
And how to access CDVWebViewEngineConfigurationDelegate
Tue, 18 Oct 2022 14:03:50 GMT
@ulimetic says
that is from a plugin in Swift
Tue, 18 Oct 2022 14:18:13 GMT
@dpogue says
https://github.com/apache/cordova-ios/pull/1050 was merged, it will be in the next major version release of cordova-ios
Tue, 18 Oct 2022 14:23:52 GMT
@ulimetic says
@dpogue Thank you, I will wait for a release. Any ETA?
Tue, 18 Oct 2022 14:38:18 GMT
@norman137 says
So does #1050 solve https://github.com/apache/cordova-ios/issues/977 as well?
Tue, 18 Oct 2022 14:49:01 GMT
@dpogue says
I think so...
Tue, 18 Oct 2022 14:53:17 GMT
@dpogue says
Personally, I understand that exposing the WKWebViewConfiguration is something people need, but I‘m also not loving exposing WebKit internal classes as part of API... this bit us before with the UIWebView transition because we had UIWebView classes in our API and apps were getting rejected for having any references to those classes. This also ends up feeling like non-WKWebView webviews (of which I’m not sure we have any on iOS? Maybe a 3rd-party UIWebView fallback plugin?) become second-class citizens, because we‘re definitely not going to expose their configuration details as part of our API. I don’t have a better suggestion, but ugh 😞
Tue, 18 Oct 2022 15:02:05 GMT
@ulimetic says
There is no UIWebView support anymore for iOS
Tue, 18 Oct 2022 15:02:20 GMT
@ulimetic says
WKWebView or die
Tue, 18 Oct 2022 15:07:48 GMT
@norman137 says
Yah I'm not sure if there is a way around that.
I mean generally speaking, in my projects I try to decouple against SDKs or APIs by creating an abstraction/interface to the SDK so that in theory the SDK/API can be swapped out for another implementation if required without changing the public interface that the application consumes itself, but that works best if you have well defined target. If Cordova would do something like that, they would have to implement the entire API to pass through to the underlying API to remain flexible which would be quite a task. Additionally in practice, those abstractions may not be enough too, as the UIWebview -> WKWebView example, pretty sure the API changed quite drastically and there still can be breaking changes involved.
Tue, 18 Oct 2022 15:20:06 GMT
@dpogue says
UIWebView still exists, and for enterprise apps not being distributed through the app store it remains an option. There‘s a community-maintained UIWebView plugin for cordova-ios via our pluggable webview API. Now that plug-in is going to need to implement a method that takes a WKWebViewConfiguration value because we’ve baked that in to our plug-in API.
Tue, 18 Oct 2022 15:26:26 GMT
@ulimetic says
Why support it? It's been deprecated... People building enterprise apps need to upgrade to non deprecated WKWebView, simple as that
Tue, 18 Oct 2022 15:27:18 GMT
@ulimetic says
Apple refuses submission and it‘s been deprecated, I don’t see why this should still be supported
Tue, 18 Oct 2022 15:58:34 GMT
@norman137 says
What dpogue is talking about is that Enterprise users don‘t go through Apple submission, it’s completely ad-hoc/in-house. The enterprise distributes devices to their staff/employees, which are linked to an Apple enterprise account and they have their own distribution system. The app distribution is nearly isolated from Apple, the only enforcement is that the ad-hoc distributions can only be distributed to specific registered devices.
Which means as long as the APIs exist in the runtime libraries on the device, they are free to use it, even if they are otherwise deprecated/banned for use on the App store.
But, in my personal views, I generally agree. Cordova should focus on app developers with the intent of distributing through the App Store. I‘m fairly sure that is majority of our Cordova Users are distributing through the Apple App Store/Google Play. (although I have absolutely no stats to back that up). It doesn’t mean we can't have enterprise users in mind, but they generally have very specialised requirements and most likely have the resources available to fork, develop and maintain plugins and/or changes to cover those specialised requirements.
> Now that plug-in is going to need to implement a method that takes a WKWebViewConfiguration value because we‘ve baked that in to our plug-in API. I think the best way to solve this concern is to implement some kind of cordova interface that by default simply interfaces with
WKWebViewConfiguration
, but the maintainers ofUIWebView
plugin can implement another object for theUIWebView
implementation. This is kind of what I was alluding to before but I honestly don’t know enough of iOS development to know if that is truly feasible.
Tue, 18 Oct 2022 16:04:38 GMT
@ulimetic says
I still don‘t see the issue. People want to use UIWebView ? Use older version of cordova-ios . Just don’t drag deprecated stuff onto newer versions...
Tue, 18 Oct 2022 16:08:35 GMT
@dpogue says
It's not just UIWebView... we have a pluggable WebView API so plugins can provide any webview they want. The stock WKWebView is just a built-in plugin that ships by default, but there are alternative WKWebView plugins too.
Tue, 18 Oct 2022 16:13:00 GMT
@norman137 says
If that's the case, we probably should have our own interface to a configuration object to remove the assumption of
WKWebView
Tue, 18 Oct 2022 16:13:29 GMT
@dpogue says
I think that ship potentially already sailed with the WKSchemeTask stuff for custom hostnames 😕
Tue, 18 Oct 2022 16:13:40 GMT
@norman137 says
true...
Tue, 18 Oct 2022 16:16:33 GMT
@ulimetic says
“we have a pluggable WebView API so plugins can provide any webview they want” : what other webview types are available? I don't understand this response. Do you mean another instance of webview already created ?
Tue, 18 Oct 2022 16:17:09 GMT
@norman137 says
Cordova doesn‘t assume (or isn’t suppose to) about the underlying webview API.
Tue, 18 Oct 2022 16:18:11 GMT
@ulimetic says
oh
Tue, 18 Oct 2022 16:18:26 GMT
@norman137 says
Apple does have rules regarding webview implementations, but again these rules only apply to apps distributing to the Apple app store.
But enterprise users could implement their own webview implementation, for example a blink (chrome) webview and have a cordova plugin that interfaces with that webview instead of using the WKWebView
Tue, 18 Oct 2022 16:18:29 GMT
@dpogue says
You could choose to use https://github.com/oracle/cordova-plugin-wkwebview-file-xhr instead of the WKWebView that ships with Cordova-iOS. Or you could chose to use https://github.com/bpresles/cordova-plugin-uiwebview-engine
Tue, 18 Oct 2022 16:19:43 GMT
@ulimetic says
Or you could chose to use https://github.com/bpresles/cordova-plugin-uiwebview-engine : but why should you that's my point
Tue, 18 Oct 2022 16:19:47 GMT
@dpogue says
Cordova provides an API, and the webview is provided by a plugin implementing that API
Tue, 18 Oct 2022 16:20:47 GMT
@dpogue says
The plugin was created after we removed UIWebView support, so clearly some people still need that functionality. We don‘t maintain the plugin, it’s just an implementation of the API that we provide.
Tue, 18 Oct 2022 16:20:56 GMT
@ulimetic says
I understand what you are saying, but still it doesn‘t make sense to use another WebView that is deprecated, and https://github.com/oracle/cordova-plugin-wkwebview-file-xhr is not a webview, it’s a layer to intercept remove calls
Tue, 18 Oct 2022 16:22:13 GMT
@ulimetic says
so you are trying to support dead or unrelated stuff
Tue, 18 Oct 2022 16:22:14 GMT
@dpogue says
oh, hmm... there's definitely some alternative WKWebView plugin implementations around
Tue, 18 Oct 2022 16:22:46 GMT
@ulimetic says
This actually makes that other plugin obsolete https://github.com/globules-io/cordova-plugin-ios-xhr
Tue, 18 Oct 2022 16:22:56 GMT
@ulimetic says
Still not a webview
Tue, 18 Oct 2022 16:23:19 GMT
@norman137 says
The point dpogue is making is that the webview might not be a WKWebView, it could be any webview.
And in the enterprise world, it's pretty common for them to be stuck on ancient software.
Tue, 18 Oct 2022 16:26:07 GMT
@ulimetic says
I understand Norman
Tue, 18 Oct 2022 16:26:40 GMT
@ulimetic says
The point is, there is no other webview engine AFAIK. Crosswalk was the only serious one and it is dead
Tue, 18 Oct 2022 16:26:53 GMT
@ulimetic says
UIWebView is deprecated
Tue, 18 Oct 2022 16:27:01 GMT
@ulimetic says
soooo
Tue, 18 Oct 2022 16:27:26 GMT
@dpogue says
That has no impact on Cordova though? It doesn't change how our WebView API works
Tue, 18 Oct 2022 16:30:28 GMT
@ulimetic says
Well, it seems like there is an abstraction layer for something that won't happen anymore, which is a custom webview.
Tue, 18 Oct 2022 16:30:46 GMT
@ulimetic says
Now we can‘t get the config of the webview because of this if I’m not mistaken
Tue, 18 Oct 2022 16:31:23 GMT
@ulimetic says
So my point is, why keep that interface when the use case does not exist anymore
Tue, 18 Oct 2022 16:32:29 GMT
@dpogue says
The existence of the UIWebView plugin is proof that the use case does exist 😛
Tue, 18 Oct 2022 16:34:03 GMT
@ulimetic says
A plugin using a deprecated webview decides for cordova core ?
Tue, 18 Oct 2022 16:34:08 GMT
@ulimetic says
LOL ?
Tue, 18 Oct 2022 16:35:13 GMT
@dpogue says
Welcome to maintaining API compatibility with software used by people in the real world
Tue, 18 Oct 2022 16:36:20 GMT
@ulimetic says
Maintaining means upgrade from deprecated stuff
Tue, 18 Oct 2022 16:36:26 GMT
@ulimetic says
not the other way around
Tue, 18 Oct 2022 16:36:54 GMT
@dpogue says
In any case, it seems like the easiest option here is to just update the API that was added in https://github.com/apache/cordova-ios/pull/1050 to take a
void*
for the configuration object instead of aWKWebViewConfiguration*
Then each plugin can check if the object it received is of the correct configuration type, and pass it in
Tue, 18 Oct 2022 16:37:31 GMT
@norman137 says
Certainly an easier suggestion than mine
Tue, 18 Oct 2022 16:38:51 GMT
@dpogue says
Since this already involves people adding their own
configuration
method overload to their ViewController, they'd be responsible for returning a configuration that matches the WebView they are actually using
Tue, 18 Oct 2022 16:40:40 GMT
@norman137 says
Yah, I generaly don‘t like
void*
but in this case, I think it’s a good fit. Allows them to directly use their webview API.
Tue, 18 Oct 2022 16:41:46 GMT
@norman137 says
And with my proposed solution, it will be easy to accidental add bad assumptions in the interface approach, which your solution will completely eliminate since there is no intermediate interface.
Tue, 18 Oct 2022 16:42:55 GMT
@dpogue says
yeah...
void*
is kinda terrible, but it's easy, and sometimes when people ask for a footgun you just need to give them a footgun and make them responsible for the results
Tue, 18 Oct 2022 16:43:21 GMT
@norman137 says
yup haha
Tue, 18 Oct 2022 17:41:31 GMT
@ulimetic says
Also, I‘d like to add that since Cordova is being used widely and more over, in enterprise setup, it’s fair to say that it should start to move away from “Due to the volunteer nature of Apache projects, we can't provide ETAs” .
Tue, 18 Oct 2022 17:41:41 GMT
@ulimetic says
Needs to have a roadmap with dates or quarters
Tue, 18 Oct 2022 17:41:48 GMT
@ulimetic says
like every other project
Tue, 18 Oct 2022 17:42:37 GMT
@ulimetic says
On one side you worry about “enterprise products” using UIWebView but then cordova has no roadmap
Tue, 18 Oct 2022 17:42:54 GMT
@ulimetic says
Can't be enterprise and no ETA
Tue, 18 Oct 2022 17:42:58 GMT
@ulimetic says
pick a side !
Tue, 18 Oct 2022 17:45:19 GMT
@norman137 says
Apache foundation is all volunteers.
Tue, 18 Oct 2022 17:45:55 GMT
@ulimetic says
So? Does that mean the project can't have a roadmap ?
Tue, 18 Oct 2022 17:46:49 GMT
@norman137 says
Some Apache projects may have an extremely active contributor base where they can make promises, but Cordova contributors are rather small and is subject to their free time. So it's unrealistic to make such promises.
Tue, 18 Oct 2022 17:46:50 GMT
@ulimetic says
Don't have to be tight deadlines
Tue, 18 Oct 2022 17:47:21 GMT
@ulimetic says
People need to know where it is going ....
Tue, 18 Oct 2022 17:49:20 GMT
@ulimetic says
And look at what happened today, turns out there are 3 issue related to the same issue, that are open, or partially merged. If there was a roadmap with features, then all these tickets would have been moved to that feature.
Tue, 18 Oct 2022 17:49:46 GMT
@ulimetic says
And then people wouldn‘t have to run in circles to know what’s going on
Tue, 18 Oct 2022 17:50:00 GMT
@ulimetic says
I get that it's your baby guys but come on
Tue, 18 Oct 2022 17:51:01 GMT
@norman137 says
You're welcome to volunteer your time to help organise issues and parse out duplicates, link related issues, etc.
Tue, 18 Oct 2022 17:51:14 GMT
@ulimetic says
Well I‘m here aren’t I ?
Tue, 18 Oct 2022 17:51:20 GMT
@ulimetic says
Also been making plugins
Tue, 18 Oct 2022 17:51:27 GMT
@ulimetic says
Do I have to take over this too ?
Tue, 18 Oct 2022 17:51:35 GMT
@ulimetic says
I can
Tue, 18 Oct 2022 17:51:46 GMT
@norman137 says
No, that's not what volunteer means.
Tue, 18 Oct 2022 17:51:58 GMT
@norman137 says
You don't have to do anything.
Tue, 18 Oct 2022 17:52:03 GMT
@ulimetic says
Well I'm volunteering to manage this
Tue, 18 Oct 2022 17:52:35 GMT
@ulimetic says
since there is no roadmap and a bunch of tickets open for like 2 years, so I guess Cordova needs help
Tue, 18 Oct 2022 17:53:09 GMT
@ulimetic says
Not trying to be mean, all I'm saying is that there should be a bit more planning
Tue, 18 Oct 2022 17:54:13 GMT
@ulimetic says
So you' re actually saying, volunteering is pushing code that is never merde
Tue, 18 Oct 2022 17:54:15 GMT
@ulimetic says
merged
Tue, 18 Oct 2022 17:54:37 GMT
@ulimetic says
since that's all there is beside your respective stuff, did I get this right ?
Tue, 18 Oct 2022 17:55:07 GMT
@ulimetic says
Like I said, I get that's your baby....
Tue, 18 Oct 2022 17:55:09 GMT
@ulimetic says
done here
Tue, 18 Oct 2022 18:00:39 GMT
@ulimetic says
What happened to https://github.com/apache/cordova-ios/projects/3
Tue, 18 Oct 2022 18:01:03 GMT
@ulimetic says
Release plan been abandonned ?
Tue, 18 Oct 2022 18:01:45 GMT
@ulimetic says
I can see someone tried at some point
Tue, 18 Oct 2022 18:04:10 GMT
@norman137 says
I generally use https://github.com/apache/cordova-ios/milestones
Tue, 18 Oct 2022 10:19:02 GMT
@hoelt says
A little more info. The SDK's project.pbxproject defines a script to copy the
modulemap
in position:shellScript = "MODULE_MAP_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap\"\nditto \"${PODS_ROOT}/Headers/Public/Braintree/Braintree.modulemap\" \"${MODULE_MAP_PATH}\"\n";
When running with cordova, it copies to file to:platforms/ios/build/emulator/Braintree.modulemap
However, this is not where compilation is trying to find it later on...
Tue, 18 Oct 2022 10:58:22 GMT
@hoelt says
OK. In the end it‘s an issue with the external SDK. It assumes that
${PODS_CONFIGURATION_BUILD_DIR}/Braintree
is always equal to${BUILT_PRODUCTS_DIR}
-- which isn’t the case when using cordova cli (which doesxcodebuild ... build CONFIGURATION_BUILD_DIR=something
).