Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25762] iOS 11.3 beta: Loading HTML in Webview errors when accessing EventListener

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-02-26T23:05:47.000+0000
Affected Version/sRelease 5.5.1, Release 6.3.0, Release 7.0.2
Fix Version/sRelease 7.1.0
ComponentsiOS
Labelsapplebug, injection, webview
ReporterVictor Vazquez Montero
AssigneeVijay Singh
Created2018-02-08T19:51:48.000+0000
Updated2018-04-23T11:15:24.000+0000

Description

*Issue* In the app they have a signature drawing controller, which loads signature.html in webview. The html has Ti.App.addEventListener & Ti.App.fireEvent to communicate between webview and controller. HTML gives error on Ti accessing in html. This is happening in iOS 11.3 beta 1 & beta 2. Code works fine on iOS 11.2 and earlier *Steps to recreate:* download TestiOSBeta run project on simulator for iOS 11.3 *Expected results:* Drawable canvas and text turn green.

Attachments

FileDateSize
Error.rtf2018-02-08T19:50:41.000+00005979
iOS11.2.png2018-02-08T19:50:54.000+000042881
iOS11.3.png2018-02-08T19:50:54.000+000064162
test_webview_native.zip2018-02-23T10:08:41.000+000042814
TestIOSBeta.zip2018-02-08T19:50:38.000+000010009955

Comments

  1. Hans Knöchel 2018-02-09

    We need to * file a bug at Apple as this is a breaking change in a non-major version (nogo). Maybe the fix it before releasing the 11.3 GA * Find out what's going on there. I suspect the evaluation may have changed * Fix it. Maybe do a 7.0.3 for this in case Apple does not fix it Test-Case: *app.js*
       var win = Ti.UI.createWindow();
       
       var webView = Ti.UI.createWebView({
       	url: 'test.html'
       });
       
       Ti.App.addEventListener('test', function(event) {
       	alert(event);
       });
       
       win.add(webView);
       win.open();
        
       
    *test.html*
       <html>
       <head>
       	<script type="text/javascript">
       		function testEvent() {
       			Ti.App.fireEvent('test', { hello: 'world' });
       		}
       	</script>
       </head>
       <body>
       	<button style="margin: 100px;" onclick="testEvent()">Trigger</button>
       </body>
       </html>
       
  2. Hans Knöchel 2018-02-10

    I've files radar #37423632 at Apple to be hopefully followed up soon.
  3. Dan Wilson 2018-02-20

    No fix in the 11.3 beta 3 released today. I'm getting worried that they GA 11.3 and it will break all my existing installs out there with no remedy. Any movement/acknowledgment on Apple's end?
  4. Anthony Chung 2018-02-21

    This is going to break our apps as well. Do you know if this is with webview and wkwebview?
  5. Hans Knöchel 2018-02-21

    We are in dialog with Apple to resolve this. It looks like they did not know about the issue before. I will update this issue once we have an update.
  6. Toru 2018-02-23

    Our app also has the same problem. It seems the script can not access Ti object at all. I am waiting for the update.
  7. Vijay Singh 2018-02-23

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9877 PR (7_1_X): https://github.com/appcelerator/titanium_mobile/pull/9878 Note - We should follow to apple to get it fixed from their side also.
  8. Hans Knöchel 2018-02-23

    Apple is investigating our native test case (also attached as "test_webview_native.zip" to this ticket) right now. If they are really not able to fix this in iOS 11.3, we have a workaround ready to be put in the next release. You can also apply the above pull request to your current SDK by modifying the "TiUIWebView.m" with the one of the ticket. Please let us know if that works for all of you guys! In addition, I will provide a custom 7.0.2 SDK that is the current GA + this fix. Thanks everyone! *EDIT*: Custom 7.0.3 build that is basically 7.0.2.GA + the above pull request ~ [Download](https://www.dropbox.com/s/yqgo91mkpuemc3y/mobilesdk-7.0.3-osx.zip?dl=1)
  9. Dan Wilson 2018-02-23

    Hans, I was able to install your modified 7.0.3 build. It actually broke some things on iOS 11.2. I use socket.io within a hidden webview within my application (don't ask -- it's legacy code). 7.0.3 breaks when I call the socket.io connect method. No error message. Just appears to stop processing. However, 7.0.3 on 11.3.beta3 gets further than it did before. Previously, it didn't even appear to be loading the local html file. Now, it gets to the same point as 11.2 with the same behavior.
  10. Hans Knöchel 2018-02-23

    [~killroyboy] Some follow up questions then: * Did the socket.io implementation work on iOS 11.2 before? If so, can you give an example? * What's the exact error message with socket.io now? * You said "some things", but only stated the socket.io one, what else? We could eventually only apply the fix for iOS 11.3 (although the Ti.App.fireEvent tests also passed on 11.2), but if you say that it even breaks 11.2, it's looks like a weird behavior, because iOS 11.2 should be unaffected by this.
  11. Dan Wilson 2018-02-23

    @hknochel Thanks for the response. 1) Yes. The app works fine with 11.2 and 7.0.1.GA. Once I switch to 7.0.3, it fails to connect. I'll try to put together an example. 2) There is no error message. It just doesn't connect and stops processing the javascript in the html file. 3) Sorry to be imprecise. The socket.io problem was the only problem I experienced because my entire app is dependent on that socket.io connection.
  12. Hans Knöchel 2018-02-24

    [~killroyboy] Interesting, interesting. Would you mind trying [this build](https://www.dropbox.com/s/mx0d4naj7rcdw50/mobilesdk-7.0.3-r2-osx.zip?dl=0) to see if it makes a difference? And we definitely need your test case.
  13. Toru 2018-02-24

    Hans, I have tried your builds. - 7.0.3 r1 with 11.3: Ti object is available, but an error occurs because html does not read external scripts. - 7.0.3 r2 with 11.3: It worked fine! I confirmed that it works well at least in my environment. Great!
  14. Hans Knöchel 2018-02-24

    [~toru] That are great news! r2 uses a different approach. [~vijaysingh] Can you update your PR to match my changes or should I file an own one? In any way, this is going into 7.1.0 which is planned for the next weeks. In addition, developers who don't trust Apple to fix the actual issue can use the 7.0.3 build right now. Thanks everyone!
  15. Dan Wilson 2018-02-24

    Hans, I can also confirm that r2 fixed both 11.2 and 11.3 issues for me. Thanks so much!
  16. Vijay Singh 2018-02-25

    [~hknoechel] I have updated master PR. Can you please update 7_1_X PR. Thanks!
  17. Hans Knöchel 2018-02-25

    All updated!
  18. Eric Wieber 2018-02-26

    FR Passed. HTML does not error in webview when accessing eventListener. Tested using provided sample code, webview suite, and confirming customer responses
  19. Eric Wieber 2018-02-28

    Verified changes are included in SDK builds: 7.1.0.v20180227113527 & 7.2.0.v20180228075644
  20. Anthony Chung 2018-03-01

    [~hknoechel] How can I install 7.0.3 r2? I tried appc ti sdk install --branch 7_1_X -d but too bleeding edge for me. I have tried appc ti sdk install --branch 7_0_X -d but is 7.0.3 r2 a specific one?
  21. Vijay Singh 2018-03-01

    [~threethirds] This change will go in 7.1.0. But you can download it from [here](https://www.dropbox.com/s/mx0d4naj7rcdw50/mobilesdk-7.0.3-r2-osx.zip?dl=0). Thanks!
  22. Anthony Chung 2018-03-01

    thanks [~vijaysingh]. appreciate it.
  23. Jignesh Kasundra 2018-04-23

    Hans Knöchel added a comment - 10/Feb/18 9:50 AM I've files radar #37423632 at Apple to be hopefully followed up soon. <<< where can I check the status of ticket? I've checked at https://openradar.appspot.com but couldn't find the radar no (#37423632).
  24. Hans Knöchel 2018-04-23

    [~jignesh.igp] 37423632 is the Apple bug reporter ID. I've just added it to my list of radars on AppSpot: https://openradar.appspot.com/radar?id=5035922554880000
  25. Jignesh Kasundra 2018-04-23

    okay. thanks Hans Knöchel

JSON Source