Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27189] Webview:Onlink property is not working properly

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionDone
Resolution Date2019-08-21T03:57:29.000+0000
Affected Version/sRelease 8.0.2
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterRakhi Mitro
AssigneeUnknown
Created2019-06-27T08:50:17.000+0000
Updated2019-08-21T19:17:20.000+0000

Description

The customer is facing this issue on using *onlink* property of webview. On SDK 8.0.2.GA when webview is created though xml file using onlink property of webview, it provides run time error(android) and the app is crashing on iOS device. *Note:* The customer noticed that *onlink* is working properly only if the webview is created inside the controller. We also tested this. On iOS,it worked properly but on android,it provides run time error. *Test Steps:* 1. Open Studio 2. Copy the sample code and paste via studio 3. Run on android and ios both. The app is crashing on iOS. On android, we got run time error in console. *Test code:* *index.js*
var handleBeforeLoadListener = function(evt) {
	console.log(JSON.stringify(evt));
};


$.webComponent.url = 'webpage.html';

$.index.open();
index.xml
<Alloy>
	<Window class="container">
		<WebView id="webComponent" onlink="handleBeforeLoadListener" />
	</Window>
</Alloy>
*Test Output:* *iOS Crashlog:*
[ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] :  Reason:
[ERROR] :  -[__NSCFString executeWithArguments:]: unrecognized selector sent to instance 0x2810962e0
[ERROR] :  Stack trace:
[ERROR] :  0   CoreFoundation                      0x000000023a1c0530 <redacted> + 252
[ERROR] :  1   libobjc.A.dylib                     0x000000023939b9f8 objc_exception_throw + 56
[ERROR] :  2   CoreFoundation                      0x000000023a0dd278 <redacted> + 0
[ERROR] :  3   CoreFoundation                      0x000000023a1c5d60 <redacted> + 1408
[ERROR] :  4   CoreFoundation                      0x000000023a1c79fc _CF_forwarding_prep_0 + 92
[ERROR] :  5   Onlink                              0x000000010458455c Onlink + 263516
[ERROR] :  6   WebKit                              0x00000002497b3440 <redacted> + 584
[ERROR] :  7   WebKit                              0x0000000249819fd4 <redacted> + 2544
[ERROR] :  8   WebKit                              0x000000024981957c <redacted> + 376
[ERROR] :  9   WebKit                              0x00000002498193cc <redacted> + 108
[ERROR] :  10  WebKit                              0x0000000249a19c08 <redacted> + 108
[ERROR] :  11  WebKit                              0x0000000249a146e0 <redacted> + 100
[ERROR] :  12  WebKit                              0x000000024967deb0 <redacted> + 120
[ERROR] :  13  WebKit                              0x000000024983b320 <redacted> + 32
[ERROR] :  14  WebKit                              0x000000024966ea20 <redacted> + 148
[ERROR] :  15  WebKit                              0x0000000249671510 <redacted> + 712
[ERROR] :  16  JavaScriptCore                      0x00000002412d3aa0 <redacted> + 276
[ERROR] :  17  JavaScriptCore                      0x00000002412d3d60 <redacted> + 36
[ERROR] :  18  CoreFoundation                      0x000000023a1522bc <redacted> + 24
[ERROR] :  19  CoreFoundation                      0x000000023a15223c <redacted> + 88
[ERROR] :  20  CoreFoundation                      0x000000023a151b24 <redacted> + 176
[ERROR] :  21  CoreFoundation                      0x000000023a14ca60 <redacted> + 1004
[ERROR] :  22  CoreFoundation                      0x000000023a14c354 CFRunLoopRunSpecific + 436
[ERROR] :  23  GraphicsServices                    0x000000023c34c79c GSEventRunModal + 104
[ERROR] :  24  UIKitCore                           0x00000002665b8b68 UIApplicationMain + 212
[ERROR] :  25  Onlink                              0x000000010454b624 Onlink + 30244
[ERROR] :  26  libdyld.dylib                       0x0000000239c128e0 <redacted> + 4
*Android:*
ERROR] :  TiAssetHelper: Error while opening asset "Resources/alloy/controllers/webpage.html":
[ERROR] :  TiAssetHelper: java.io.FileNotFoundException: Resources/alloy/controllers/webpage.html
[ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.openAsset(Native Method)
[ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:690)
[ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:664)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.util.KrollAssetHelper.openAsset(KrollAssetHelper.java:135)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.io.TiResourceFile.getInputStream(TiResourceFile.java:72)
[ERROR] :  TiAssetHelper: 	at ti.modules.titanium.ui.widget.webview.TiUIWebView.setUrl(TiUIWebView.java:612)
[ERROR] :  TiAssetHelper: 	at ti.modules.titanium.ui.widget.webview.TiUIWebView.processProperties(TiUIWebView.java:462)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1296)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:506)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:513)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:602)
[ERROR] :  TiAssetHelper: 	at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:305)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:57)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:578)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:726)
[ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)
[ERROR] :  TiAssetHelper: 	at android.app.Activity.performCreate(Activity.java:7372)
[ERROR] :  TiAssetHelper: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
[ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
[ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
[ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.-wrap12(Unknown Source:0)
[ERROR] :  TiAssetHelper: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
[ERROR] :  TiAssetHelper: 	at android.os.Handler.dispatchMessage(Handler.java:108)
[ERROR] :  TiAssetHelper: 	at android.os.Looper.loop(Looper.java:166)
[ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.main(ActivityThread.java:7425)
[ERROR] :  TiAssetHelper: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiAssetHelper: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
[ERROR] :  TiAssetHelper: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
[ERROR] :  TiExceptionHandler: (main) [11,502] null
[ERROR] :  TiExceptionHandler:
[ERROR] :  TiExceptionHandler:     java.io.Reader.<init>(Reader.java:78)
[ERROR] :  TiExceptionHandler:     java.io.InputStreamReader.<init>(InputStreamReader.java:97)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.widget.webview.TiUIWebView.setUrl(TiUIWebView.java:613)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.widget.webview.TiUIWebView.processProperties(TiUIWebView.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1296)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:506)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:513)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:602)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:305)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:57)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:578)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:726)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)
[ERROR] :  TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7372)
[ERROR] :  TiExceptionHandler:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.-wrap12(Unknown Source:0)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
[ERROR] :  TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:108)
[ERROR] :  TiExceptionHandler:     android.os.Looper.loop(Looper.java:166)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7425)
[ERROR] :  TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiExceptionHandler:     com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
[ERROR] :  TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
[ERROR] :  TiExceptionHandler: (main) [1,503] null
[ERROR] :  TiExceptionHandler:
[ERROR] :  TiExceptionHandler:     java.io.Reader.<init>(Reader.java:78)
[ERROR] :  TiExceptionHandler:     java.io.InputStreamReader.<init>(InputStreamReader.java:97)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.widget.webview.TiUIWebView.setUrl(TiUIWebView.java:613)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.widget.webview.TiUIWebView.processProperties(TiUIWebView.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1296)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:506)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:513)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:602)
[ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:305)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:57)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:578)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:726)
[ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)
[ERROR] :  TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7372)
[ERROR] :  TiExceptionHandler:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.-wrap12(Unknown Source:0)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
[ERROR] :  TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:108)
[ERROR] :  TiExceptionHandler:     android.os.Looper.loop(Looper.java:166)
[ERROR] :  TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7425)
[ERROR] :  TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiExceptionHandler:     com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
[ERROR] :  TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Attachments

FileDateSize
Onlink.zip2019-07-11T15:29:38.000+00008704762

Comments

  1. Sharif AbuDarda 2019-07-10

    Hello [~gmathews], [~jquick], Can you please look into this issue. We are able to reproduce the issue. Thanks.
  2. Joshua Quick 2019-07-11

    [~sdarda], regarding the Android issue, it has nothing to do with "onlink". The "FileNotFoundException" is telling you exactly what's wrong. It's failing to find the HTML file. The issue is the WebView was given a "relative path" to the HTML file. The relative path handling between Android and iOS are different. On Android, file paths are relative to the JavaScript file (or XML file in Alloy) that invoked it. On iOS, file paths are relative to the app's "Resources" directory. The best solution is to give it an "absolute path" to the HTML file. So, the solution is to change this...
       $.webComponent.url = 'webpage.html';
       
    ...to the below...
       // Add a leading slash '/' in front of the HTML file path.
       $.webComponent.url = '/webpage.html';
       
    Using an absolute path as shown above will work on both Android and iOS.
  3. Sharif AbuDarda 2019-07-11

    Hello [~jquick], The issue in the iOS is still there after making the above change. App still crashes in open
       [ERROR] The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.
       [ERROR] Reason:
       [ERROR] Completion handler passed to -[TiUIWebView webView:decidePolicyForNavigationAction:decisionHandler:] was not called
       [ERROR] Stack trace:
       [ERROR] 0   CoreFoundation                      0x000000010f0746fb __exceptionPreprocess + 331
       [ERROR] 1   libobjc.A.dylib                     0x000000010df2fac5 objc_exception_throw + 48
       [ERROR] 2   CoreFoundation                      0x000000010f074555 +[NSException raise:format:] + 197
       [ERROR] 3   WebKit                              0x000000011043c1fd _ZN6WebKit28CompletionHandlerCallCheckerD2Ev + 125
       [ERROR] 4   WebKit                              0x00000001104e6f1d _ZNK3WTF20ThreadSafeRefCountedIN6WebKit28CompletionHandlerCallCheckerELNS_17DestructionThreadE0EE5derefEv + 33
       [ERROR] 5   WebKit                              0x00000001104c85c5 _ZZN3WTF8BlockPtrIFv24WKNavigationActionPolicyEE12fromCallableIZN6WebKit15NavigationState16NavigationClient31decidePolicyForNavigationActionERNS5_12WebPageProxyEONS_3RefIN3API16NavigationActionENS_13DumbPtrTraitsISC_EEEEONSA_INS5_27WebFramePolicyListenerProxyENSD_ISH_EEEEPNSB_6ObjectEE3$_5EES3_T_ENUlPKvE_8__invokeESQ_ + 37
       [ERROR] 6   libsystem_blocks.dylib              0x00000001114e99cd _Block_release + 105
       [ERROR] 7   WebKit                              0x00000001104c5406 _ZN6WebKit15NavigationState16NavigationClient31decidePolicyForNavigationActionERNS_12WebPageProxyEON3WTF3RefIN3API16NavigationActionENS4_13DumbPtrTraitsIS7_EEEEONS5_INS_27WebFramePolicyListenerProxyENS8_ISC_EEEEPNS6_6ObjectE + 852
       [ERROR] 8   WebKit                              0x0000000110528d81 _ZN6WebKit12WebPageProxy31decidePolicyForNavigationActionEON3WTF3RefINS_15WebProcessProxyENS1_13DumbPtrTraitsIS3_EEEERNS_13WebFrameProxyEON7WebCore18SecurityOriginDataEyONS_20NavigationActionDataEONS_13FrameInfoDataEyRKNSA_15ResourceRequestEOSH_ON3IPC17FormDataReferenceEONSA_16ResourceResponseERKNS_8UserDataEONS2_INS0_20PolicyDecisionSenderENS4_IST_EEEE + 3299
       [ERROR] 9   WebKit                              0x0000000110528051 _ZN6WebKit12WebPageProxy42decidePolicyForNavigationActionAsyncSharedEON3WTF3RefINS_15WebProcessProxyENS1_13DumbPtrTraitsIS3_EEEEyON7WebCore18SecurityOriginDataENS8_21PolicyCheckIdentifierEyONS_20NavigationActionDataEONS_13FrameInfoDataEyRKNS8_15ResourceRequestEOSG_ON3IPC17FormDataReferenceEONS8_16ResourceResponseERKNS_8UserDataEy + 283
       [ERROR] 10  WebKit                              0x0000000110527f06 _ZN6WebKit12WebPageProxy36decidePolicyForNavigationActionAsyncEyON7WebCore18SecurityOriginDataENS1_21PolicyCheckIdentifierEyONS_20NavigationActionDataEONS_13FrameInfoDataEyRKNS1_15ResourceRequestEOS9_ON3IPC17FormDataReferenceEONS1_16ResourceResponseERKNS_8UserDataEy + 102
       [ERROR] 11  WebKit                              0x0000000110730b06 _ZN3IPC22callMemberFunctionImplIN6WebKit12WebPageProxyEMS2_FvyON7WebCore18SecurityOriginDataENS3_21PolicyCheckIdentifierEyONS1_20NavigationActionDataEONS1_13FrameInfoDataEyRKNS3_15ResourceRequestEOSB_ONS_17FormDataReferenceEONS3_16ResourceResponseERKNS1_8UserDataEyENSt3__15tupleIJyS4_S6_yS7_S9_ySB_SB_SF_SH_SJ_yEEEJLm0ELm1ELm2ELm3ELm4ELm5ELm6ELm7ELm8ELm9ELm10ELm11ELm12EEEEvPT_T0_OT1_NSO_16integer_sequenceImJXspT2_EEEE + 129
       [ERROR] 12  WebKit                              0x000000011072aaa7 _ZN3IPC13handleMessageIN8Messages12WebPageProxy36DecidePolicyForNavigationActionAsyncEN6WebKit12WebPageProxyEMS5_FvyON7WebCore18SecurityOriginDataENS6_21PolicyCheckIdentifierEyONS4_20NavigationActionDataEONS4_13FrameInfoDataEyRKNS6_15ResourceRequestEOSE_ONS_17FormDataReferenceEONS6_16ResourceResponseERKNS4_8UserDataEyEEEvRNS_7DecoderEPT0_T1_ + 102
       [ERROR] 13  WebKit                              0x00000001103932a6 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE + 126
       [ERROR] 14  WebKit                              0x0000000110549762 _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 24
       [ERROR] 15  WebKit                              0x00000001103861c8 _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 108
       [ERROR] 16  WebKit                              0x0000000110388bdd _ZN3IPC10Connection24dispatchIncomingMessagesEv + 717
       [ERROR] 17  JavaScriptCore                      0x0000000108d271f4 _ZN3WTF7RunLoop11performWorkEv + 228
       [ERROR] 18  JavaScriptCore                      0x0000000108d27482 _ZN3WTF7RunLoop11performWorkEPv + 34
       [ERROR] 19  CoreFoundation                      0x000000010efdbbe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
       [ERROR] 20  CoreFoundation                      0x000000010efdb463 __CFRunLoopDoSources0 + 243
       [ERROR] 21  CoreFoundation                      0x000000010efd5b1f __CFRunLoopRun + 1231
       [ERROR] 22  CoreFoundation                      0x000000010efd5302 CFRunLoopRunSpecific + 626
       [ERROR] 23  GraphicsServices                    0x00000001134fb2fe GSEventRunModal + 65
       [ERROR] 24  UIKitCore                           0x000000011ad64ba2 UIApplicationMain + 140
       [ERROR] 25  TestBeforeload                      0x000000010884a2e6 main + 1046
       [ERROR] 26  libdyld.dylib                       0x0000000111463541 start + 1
       [ERROR] 27  ???                                 0x0000000000000001 0x0 + 1
       
    Can you please try the attached project. Using the absolute path the error in endroid is solved. The iOS crash is still occuring with the 8.0.2.GA SDK. Thanks.
  4. Jan Vennemann 2019-07-11

    This seems to be a limitation in Alloy. You can't assign functions directly to properties like it is required for onlink. *EDIT:* The workaround i provided before did not work. [~jquick] is currently trying out another solution.
  5. Joshua Quick 2019-07-11

    The following will work on both Android and iOS. You should set the onlink callback to empty string in the XML file and then set the onlink property directly in your JavaScript. Also, don't forget the leading slash for the HTML file to reference it by absolute path since relative path handling is different between Android and iOS. index.xml
       <Alloy>
       	<Window class="container">
       		<WebView id="webComponent" onlink=""/>
       	</Window>
       </Alloy>
       
    index.js
       $.webComponent.onlink  = function(e) {
       	alert('The onlink callback was successfully invoked.');
       	return true;  // <- Return true to allow link to load. Return false to override.
       };
       $.webComponent.url = '/webpage.html';
       $.index.open();
       
  6. Joshua Quick 2019-07-11

    [~sdarda], Jan has deleted his code from his comment in favor of mine. My change will work. Try it out.
  7. Sharif AbuDarda 2019-07-12

    Hello [~jquick], your code worked. I have deleted my other reply. Can you confirm what was wrong on the previous code and also in the customer code? If this is a limitation in Alloy as Jan said, any plan on fixing this in the future or maybe document the way of handling onlink in iOS? Thanks for the guide.
  8. Joshua Quick 2019-07-12

  9. Sharif AbuDarda 2019-07-12

    Hello [~jquick], Thank you for the information. Also, thanks for creating the other ticket. I already provided your solution to the customer. Customer will be happy to see the improvement ticket. I will update the customer on that. Do you think we keep this ticket open? or we can close it? Thanks for your support.
  10. Joshua Quick 2019-07-12

JSON Source