Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5691] iOS: Ti.App.fireEvent not work on sdk 7.0.2

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2018-04-04T07:13:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterSathaphorn Kerdmalai
AssigneeShak Hossain
Created2018-04-04T03:41:47.000+0000
Updated2018-04-04T07:13:00.000+0000

Description

var win = Ti.UI.createWindow(); var webview = Ti.UI.createWebView({ url: 'logging.html' }); var button = Ti.UI.createButton({ title: 'fromTitanium', height: '50dp', width: '130dp' }); button.addEventListener('click', function(e) { Ti.App.fireEvent('app:fromTitanium', { message: 'event fired from Titanium, handled in WebView' }); }); Ti.App.addEventListener('app:fromWebView', function(e) { alert(e.message); }); win.add(webview); win.add(button); win.open(); I try this on my local web view but it's not working.

Comments

  1. Mostafizur Rahman 2018-04-04

    Hello [~iblack.dum], Thanks for sharing with us. Can you please explain more which is not working? Tested the sample code from [here](https://docs.appcelerator.com/platform/latest/#!/guide/Communication_Between_WebViews_and_Titanium-section-src-29004919_CommunicationBetweenWebViewsandTitanium-Ti.AppEvents) and it is working as expected on simulator using SDK 7.1.0.GA and 7.0.2.GA. Here is the [output](https://s18.postimg.org/fomqovnvt/Simulator_Screen_Shot_-_i_Phone_X_-_2018-04-04_at_10.50.59.png).It would be great if you you can update your SDK to the latest. Please test the sample code from the documentation and let us know how it goes.
  2. Sathaphorn Kerdmalai 2018-04-04

    @Mostafizur Rahman I try with [code](https://docs.appcelerator.com/platform/latest/#!/guide/Communication_Between_WebViews_and_Titanium-section-src-29004919_CommunicationBetweenWebViewsandTitanium-Ti.AppEvents) it not working on sdk 7.0.2 there is no alert when I click on webview. But I change sdk to 7.1.0 it working. How can i fixed on 7.0.2 if i have to use these sdk. Thank you
  3. Hans Knöchel 2018-04-04

    Apple broke the inter-app communication between iOS 11.2 and iOS 11.3, so we applied a workaround in TIMOB-25762 as part of 7.1.0 that fixes their issue. See the linked pull request for details. It can be applied to your own SDK if necessary.

JSON Source