farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
62 stars 39 forks source link

iOS: Migrate from UIWebView to WKWebView #320

Closed jgaehring closed 4 years ago

jgaehring commented 4 years ago

Per this deprecation notice from Apple:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs starting from April 2020 . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

Looks like we'll need to use this plugin in order to migrate: https://github.com/apache/cordova-plugin-wkwebview-engine

Official blog post from Cordova re: this migration: https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html

jgaehring commented 4 years ago

Attempting to use the above plugin with commit c549d7b12201224f07a9e2ec920667c776d8a516. Won't know for sure if it worked though until I actually try to upload to the store.

:crossed_fingers:

jgaehring commented 4 years ago

Welp, despite resolving #323, I still got the same deprecation notice from Apple as quoted above when I submitted v0.4.16. :frowning_face:

At some point, when reading up on how the plugin works, I came across some mentions of other developers still getting the same warning, even after they added the plugin. I think it had something to do with references to UIWebView still being present somewhere in the config files that Cordova generates, despite it not being actively used. I'll have to try to retrace my steps and see if I can find that again.

jgaehring commented 4 years ago

Found it!

https://github.com/apache/cordova-plugin-wkwebview-engine/issues/125#issuecomment-560437509

Looks pretty straight-forward, will have to try it next time I run a build.

jgaehring commented 4 years ago

The most thorough and up-to-date documentation appears to be here:

https://cordova.apache.org/howto/2020/03/18/wkwebviewonly.html

I also recall seeing a comment somewhere about passing a flag to the build command, something like,

cordova build ios --WKWebViewOnly="true"

But I can't find any mention of that now. Seems like the added configuration to config.xml is now what's preferred, so I think I will leave it at that.