Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6498] iOS : image file not loading into the webview from applicationDataDirectory

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsapplicationDataDirectory, ios, webView
ReporterJignesh Kasundra
AssigneeAbir Mukherjee
Created2020-02-28T09:47:38.000+0000
Updated2020-03-30T08:40:21.000+0000

Description

On iOS device (iOS 12.3.1) the image file is not getting loaded into webview from iPhone/iPAD storage (applicationDataDirectory).

Attachments

FileDateSize
app.js2020-02-28T09:46:43.000+000045446

Comments

  1. Rene Pot 2020-02-28

    Thanks for the report, looks like a regression issue! I tried to reproduce, here are my results (all to iPhone 11 with iOS 13.3): - SDK 8.2.1.GA - works as expected - SDK 8.3.0.GA - image fails loading - SDK 8.3.1.GA - image fails loading - SDK 9.0.0.v20200224113949 - image fails loading.
  2. Vijay Singh 2020-02-28

    I'll check. In 9.0.0 we have new property 'assetsDirectory' . Probably it can help to fix the issue. See TIMOB-27159.
  3. Joshua Quick 2020-02-28

    [~vijaysingh] is correct. In Titanium 8.0.0, we switched out the native iOS implementation from Apple's deprecated UIWebView to WKWebView. Apple's WKWebView has a breaking-change (in an effort to make it more secure) where it needs to be given permission to access files from local storage. You have to give it permission via the new property mentioned above which was introduced into Titanium 9.0.0. Alternatively, you can references images within your app's Resources directory instead. This will work in 8.0.0 and above.
  4. Jignesh Kasundra 2020-03-02

    I have e-reading base app which downloads the content (Image , JS , Css) from server and store into applicationDataDirectory. we need to access the content from applicationDataDirectory to present the content on webview is it possible to merge assetsDirectory property under 8.0.0 and above SDK?
  5. Jignesh Kasundra 2020-03-02

    attached sample example also not working with SDK 8.2.1.GA - tested on iPhone 5s 12.4.4
  6. Rene Pot 2020-03-03

    [~jignesh.igp] If it were to be backported it would go to the 8.3.x branch. However, I would not count on that. Can you test with the recommended solution and report back?
  7. Jignesh Kasundra 2020-03-04

    Hi Rene Pot, yes but app's Resources directory is not use full for our app as it remains static and our app using dynamic content from server. the app is based on ebook reading so it have lots of images, css , js files we are unable to move on latest SDK and release the app because of applicationDataDirectory accessibility issue. it will be helpful to merge assetsDirectory property with 8.3.x branch thanks.
  8. Rene Pot 2020-03-04

    [~jignesh.igp] wouldn't it be easier in that case to load the image from the remote url directly instead of downloading it?
  9. Jignesh Kasundra 2020-03-05

    we are committed to user that our app will functional in offline mode to read the ebook. so we can't use the remote url. it causes the issue for user if device has no network connection
  10. Jignesh Kasundra 2020-03-28

    Hi Rene Pot, can you please help me and suggest the solution ?
  11. Rene Pot 2020-03-30

    Hi, please follow instructions on how to configure this with SDK 9.0.0 (assetDirectory) and use 9.0.0 for your app.

JSON Source