jepiqueau / jeep

Jeep Web Component Library and Apps
MIT License
19 stars 6 forks source link

UIWebView API Usage #9

Closed flipace closed 4 years ago

flipace commented 4 years ago

Hi, we recently received warnings from apple about our apps using UIWebView APIs again.

After some investigation we found that the only plugin we use which still seems to import UIWebView stuff is the sqlite storage plugin - is there any way to remove to associated code somehow?

Did anyone else encounter the same warning recently?

jepiqueau commented 4 years ago

@flipace according to ``` https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/


 On September 4th, 2019, the Ionic team shipped a new Capacitor release (here’s the v1.2.0 changelog) that removed references to UIWebView.
The current release of @jeepq/capacitor use the Capacitor release 1.5.0, so it should not come from the plugin but certainly come from some cordova plugins used by your application.
Which plugin are you using ? capacitor-data-storage-sqlite, capacitor-sqlite or capacitor-video-player so i could have a deeper search
flipace commented 4 years ago

@jepiqueau yes, i know - however, there's still some uiwebview code in their package. but this code is not imported by anything as far as i could tell.

When trying to figure out which code imports something from the uiwebview part of capacitor - the only plugin i could find was the capacitor-data-storage-sqlite plugin.

I'm not sure, and I'm afraid apple does not provide any tools to test, but I think it may be related to the import of CDVUIWebViewDelegate here: https://github.com/jepiqueau/jeep/blob/master/capacitor/plugins-library/ios/Pods/Target%20Support%20Files/CapacitorCordova/CapacitorCordova-umbrella.h

When we switched to capacitor in the first place, the warning went away. It could also be that it's not related to this plugin, but as mentioned - it's the only place where we could find uiwebview referenced in some way - outside of the capacitor core.

Do you think the CapacitorCordova-umbrella.h (or the whole CapacitorCordova) stuff in this plugin can be removed? I'm afraid I have no idea what it's used for here..

jepiqueau commented 4 years ago

@flipace May be it is a good idea. Could you try to remove it from a copy of your app directly in xcode and see if it works. Tell me about the result. i will have to go deeper to understand what is happening but i am currently on something else. Thanks for your help

jepiqueau commented 4 years ago

@flipace Is your App an Angular App and if yes are you using @ionic-native/core,@ionic-native/splash-screen or @ionic-native/status-bar. I think this plugins are using cordova plugins ?

flipace commented 4 years ago

@jepiqueau no, it's a react app and we're using capacitor as the mobile bridge.

These are our used plugins. When searching for UIWebView accross all the generated xcode source code - the only occurrence is in capacitor core itself and capacitor-data-storage-sqlite:

  "@capacitor/android": "^1.5.1",
    "@capacitor/ios": "^1.5.1",
    "@ovos-media/fancy-notifications": "^0.0.8",
    "capacitor-data-storage-sqlite": "^1.2.1-10",
    "capacitor-fcm": "^1.0.1",
    "cordova-plugin-appminimize": "^1.0.1",
    "cordova-plugin-badge": "^0.8.8",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-fetch": "https://github.com/aporat/cordova-plugin-fetch.git#c8a47fde8d04614505d504e36963f03b038243c1",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-fullscreen": "^1.2.0",
    "cordova-plugin-local-notification": "https://github.com/Steffaan/cordova-plugin-local-notifications.git#06863a7b453706a1335119ac7cdd7cc157f765de",
    "cordova-plugin-screen-orientation": "^3.0.2",
    "cordova-plugin-whitelist": "^1.3.4",
jepiqueau commented 4 years ago

@flipace I saw that you are using a really old release of capacitor-data-storage-sqlite. there is a release developed and tested with capacitor 1.5 so can you please install it and tell me if you have still the issue

npm install --save @jeepq/capacitor

the latest release is 0.0.3 there is also a react app showing how to implement it

https://github.com/jepiqueau/react-datastoragesqlite-app
jepiqueau commented 4 years ago

@flipace Looking deeper at the doc : https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/ , in the chapter Using Capacitor?, they mention : <<<You may notice “UIWebView” references within your Capacitor-based iOS project. Files within the “CapacitorCordova” pod, for example, relate to Cordova compatibility. These will not trigger the warning. >>> I have opened a question on the Capacitor channel in Slack so let see if someone from the Ionic team will advise.

jepiqueau commented 4 years ago

@flipace Have you solved the issue

flipace commented 4 years ago

@jepiqueau thanks for digging into it.

I have not yet solved the issue - there's also not really a way to easily test this for us since we're bound to release cycles and a new release is the only way to send sth to apple and possibly get the warning (or no warning) back.

I did not update to @jeepq/capacitor yet since I found that it has the same reference to the UIWebView stuff. No other plugin we use does that - that's why I thought that it may be due to this plugin, and not the others.

What are the Target Support Files for?

jepiqueau commented 4 years ago

@flipace thanks for your reply. yes it is difficult to test this, i am not publishing app to apple but i didn't hear anything from anybody else. Do not update to @jeepq/capacitor as i am stepping back to individual plugin following the advice of the Ionic Capacitor team. There is now a new release of the capacitor-data-storage-sqlite 1.5.1-2. the @jeepq/capacitor will be deprecated soon. I do not understand your question about the Target Support files so can you be more precise

flipace commented 4 years ago

Oh okay, thanks for the heads up!

About Target Support Files - what is this folder (and the files in there) used for -> https://github.com/jepiqueau/jeep/tree/master/capacitor/plugins-library/ios/Pods/Target%20Support%20Files/CapacitorCordova

In the iOS Plugin demo from capacitor this folder does not exist, and I'd like to understand why it is necessary here - does it have something to do with the SQLite dependencies?

socalrunner commented 4 years ago

@flipace just a note, I've noticed that I can do a quick test for this issue by just uploading the bundle. If you upload it to test flight you will see the warning as soon as it's done processing and available for testing. So, no need to wait for the release cycle to validate the bundle.

jepiqueau commented 4 years ago

@flipace @socalrunner I just make a simple test which shows that this is nothing to do withSQLite dependencies. I create a fresh new capacitor plugin using the capacitor documentation: npx @capacitor/cli plugin:generate and name it capacitor-test-default then npm run build and also build it in Xcode and Android studio and upload it to the following github repository https://github.com/jepiqueau/capacitor-test-default You can see that the Target Support Files with the CapacitorCordava folder exists https://github.com/jepiqueau/capacitor-test-default/tree/master/ios/Pods/Target%20Support%20Files/CapacitorCordova

jepiqueau commented 4 years ago

@socalrunner Can you detail step by step the procedure for the quick test a s i am not familiar with publishing an apple app. So if i can replicate the issue, i could open an issue the the Ionic Capacitor team.

flipace commented 4 years ago

@socalrunner Can you detail step by step the procedure for the quick test a s i am not familiar with publishing an apple app. So if i can replicate the issue, i could open an issue the the Ionic Capacitor team.

I'm doing this now! Will keep you updated.

flipace commented 4 years ago

@jepiqueau after further debugging and commenting out various other pods - i found that one of our plugins depended on google mobile vision which seems to have triggered the warning. sorry for bothering you, it looks like it's working now with some changes.

to others running into such a problem - here's a capacitor ios scanner plugin which does not rely on 3rd party libs: https://github.com/rdlabo/capacitor-codescanner

jepiqueau commented 4 years ago

@flipace I am happy that you found the reason. you are welcome