apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

Cordova6.1.0 doesn't support iOS10. #1009

Closed lynntangyuan closed 3 years ago

lynntangyuan commented 3 years ago

Bug Report

Problem

Cordova6.1.0 doesn't support iOS10. However, users who use ios10 also account for a certain proportion, So How can I not only use Cordova6.1.0, but also support IOS 10.

Or, Could you please point out the code that IOS 10 doesn't support in Cordova6.1.0, and I can modify it myself.

What is expected to happen?

Corodva6.1.0 supports iOS10.

What does actually happen?

The document of Cordova6.1.0 states that Cordova6.1.0 only supports iOS11 and above.

Information

Command or Code

platform :ios, '11.0'

Environment, Platform, Device

Version information

Checklist

breautek commented 3 years ago

If you need iOS 10 support then stay on cordova-ios@5

You'll need to use cordova-ios@5.1.1 with a WKWebView plugin and the WKWebViewOnly preference enabled to be WKWebView compliant.

Or, Could you please point out the code that IOS 10 doesn't support in Cordova6.1.0, and I can modify it myself.

The reason cordova-ios@6 requires iOS 11+ is because of the scheme handler stuff. I'm not familiar with the codebase so I can't point to exactly where this is located, but the apple docs for this is located here. You should be able to search and find usages within the cordova-ios codebase easily enough.

This was added to support schemes, which solves many CORS related issues that appeared on the WKWebView loading files from the local filesystem.

As far as I know, this is the only thing that was added that requires cordova-ios@6 but if you strip that out and try to build, I'm sure XCode will tell you if there are anything else that requires iOS 11 if you try to build with deployment target with iOS 10.

lynntangyuan commented 3 years ago

@breautek Thanks for your reply. I Found out the usage of WKUrlSchemeHandler, However, When I tried to strip that out , and update the minimum deployment target to iOS11.0, It pointed out that Cordova6.1.1 required a higher minimum deployment target and resulted in an error. It must be the Rigid requirements of Cordova6.1.1 in Cocoapods, is there any way for me to skip this error?

erisu commented 3 years ago

There are a few places that defines the deployment target.

As @breautek mentioned, it might be easier to use Cordova-iOS 5.x as it supports iOS 10.

lynntangyuan commented 3 years ago

@erisu Depending on the policy published by Apple, In few months, Apple will force that The keyword "UIWebview" does not exist in the code of App. However, Despite setting "WKWebviewOnly", The keyword "UIWebview" still exists in Cordova-ios@5.1.1.

dpogue commented 3 years ago

Cordova-iOS 6.0.0 also uses Named Colours for CDVViewController and the LaunchStoryboard, which require iOS 11.

Using Cordova-iOS 5.1.1 with WKWebViewOnly ensures there are no references to UIWebView and should not run into any problems with Apple.