Re:Apple starts rejecting apps with “hot code push” features
by orbitur on Wednesday March 08, 2017 @11:06AM
(#13821141)
If they're using JSC, then they can definitely download JS and execute native methods. They could subclass any UIKit object and make it conform to JSExport. Done, now they're "running native code."
[ Parent
| on HN ]
Re:Apple starts rejecting apps with “hot code push” features
by mikeash on Wednesday March 08, 2017 @11:09AM
(#13821161)
Sure, and an app displaying a web page using WebView can provide hooks that allow doing that sort of thing too. Neither one is downloading native code.
Re:Apple starts rejecting apps with “hot code push” features
by orbitur on Wednesday March 08, 2017 @11:12AM
(#13821193)
Only UIWebView, which is going away soon.
But surely you can see the difference between executing limited actions inside a web view, and making available any native method to a web view.
Re:Apple starts rejecting apps with “hot code push” features
by mikeash on Wednesday March 08, 2017 @11:18AM
(#13821243)
WKWebView allows the app to execute arbitrary JS within the loaded page, and intercept URL loads and other actions made by JS code. That's all you need to build a bridge.
I don't see any fundamental difference here. Both (UI|WK)WebView and JSC allow bridging. Neither one grants full access to JS code automatically, the programmer has to put some effort into it. And even if there is some important difference, neither one is native code which is what I was disputing above.