marcuswestin / WebViewJavascriptBridge

An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews
http://marcuswest.in
MIT License
14.27k stars 2.98k forks source link

Removing UIWebView support #391

Open stury opened 4 years ago

stury commented 4 years ago

Removing UIWebView support from this library, since Apple is now warning developers of the usage of the UIWebView APIs when submitting apps to the App Store for review. 


  1. Removed UIWebView support from the code, and the tests 
2. Kept the WebView macOS support, as I don't think that has been targetted by Apple yet. 
3. Updated the README.md file to remove any UIWebView references. 
4. Update the podspec (version number, and description)

We are under the impression that since ht eUIWebView warning is being shown to all apps being submitted to Apple, that it's just a matter of time before iOS apps will not be allowed to ship with this code. This will help eliminate that possibility. If a user needs UIWebView support, they can always use the 6.x version of the library.

Thanks for taking a look at this patch @marcuswestin!

stury commented 4 years ago

@marcuswestin Here is the wording from Apple on submissions referencing UIWebView:

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

stury commented 4 years ago

How do I get the continuous-integration/travis-ci check to run for this PR? I'd love to move this forward.

stury commented 4 years ago

@marcuswestin Please take a look at this PR.

Apple published a note on December 23, 2019 stating that apps shipping with UIWebView support will be rejected as of April 2020.

Here's the link to the article: Updating Apps that Use Web Views

This PR should remove UIWebView from the codebase. I did not remove it from the macOS target, but I can do that work if you'd like.

We have several apps that rely on this framework, and would love to support your Open Source efforts with this patch to keep things working moving forward.

Thanks for the consideration.

stury commented 4 years ago

@marcuswestin It would be nice to get this PR merged and released before the April 2020 deadline. It's February now, and people will need time to migrate up to the latest version of the SDK. This update will eliminate the chance that a consuming app will have of being rejected by Apple upon submission in April.

Let me know if you have any questions.

hrabkin commented 4 years ago

The owner of the repository is probably won't support it anymore =(

hrabkin commented 4 years ago

Actually your pull request doesn't remove fully UIWebView code

stury commented 4 years ago

Actually your pull request doesn't remove fully UIWebView code

@GRyabkin Only UIWebView code I see in my branch is in the Example app. I can remove it from there as well.

hrabkin commented 4 years ago

@stury take a look at WebViewJavascriptBridge.m it has conditional branching to use UIWebView if it's iOS version macros lower than iOS version with WKWebView

stury commented 4 years ago

@GRyabkin Sorry, you are correct! Updated, and removed the rest of the references I could find. Let me know if you see anything else I need to clean up. All Tests pass, and the sample app works without UIWebView.

Oh, and thank you for reviewing the changes! 😄

akbayt commented 4 years ago

@stury thanks for your effort :)

I am exactly in a situation you described. Our new app rejected due to the usage of UIWebView, which comes from this package actually. Did you happen to fork from this project for your update?

Otherwise, I am going to use this one: https://cocoapods.org/pods/WKWebViewJavascriptBridge

stury commented 4 years ago

@akbayt I did fork from this repo: https://github.com/stury/WebViewJavascriptBridge/tree/Remove-UIWebView-Support

You can use that fork, or try out the WKWebViewJavascriptBridge. I hadn't seen that one before. Looks like they have the right idea. Cheers!

akbayt commented 4 years ago

@stury thanks for the quick answer.

WKWebViewJavascriptBridge didn't work for me. It doesn't give the option to set WebView delegate (setWebViewDelegate), which necessary for me to handle URL redirections.

I will try your fork. I will try adding it manually since the pod installation doesn't work:

pod 'WebViewJavascriptBridge', '~> 7.0'

or do you have a pod with a different name?

stury commented 4 years ago

@akbayt I believe I've merged everything to master at this point in my fork, so you should be able to just use the following:

pod 'WebViewJavascriptBridge', :git => 'git@github.com:stury/WebViewJavascriptBridge.git', :branch => 'master'

Or you can replace the git@github with the HTTPS URL if you'd rather:

pod 'WebViewJavascriptBridge', :git => 'https://github.com/stury/WebViewJavascriptBridge.git', :branch => 'master'

Give that a shot, and it should work.

akbayt commented 4 years ago

@stury worked just fine!

I tested essential functionalities, all works fine. And also, I tried to upload a new version to the app store connect; it didn't give the warning about unsupported UIWebView.

Thanks, this saved my time a lot :)

truongluuxuan commented 3 years ago

Thank @stury , you save my day

ajabade commented 3 years ago

@stury -Thank a lot.

You saved lots of time. When it will be available on the cocoa pod?

Once again thank you

SunnyJ-CN commented 2 years ago

@stury Thank you, really helped

@akbayt I believe I've merged everything to master at this point in my fork, so you should be able to just use the following:

pod 'WebViewJavascriptBridge', :git => 'git@github.com:stury/WebViewJavascriptBridge.git', :branch => 'master'

Or you can replace the git@github with the HTTPS URL if you'd rather:

pod 'WebViewJavascriptBridge', :git => 'https://github.com/stury/WebViewJavascriptBridge.git', :branch => 'master'

Give that a shot, and it should work.