[AC-6498] iOS : image file not loading into the webview from applicationDataDirectory
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | applicationDataDirectory, ios, webView |
Reporter | Jignesh Kasundra |
Assignee | Abir Mukherjee |
Created | 2020-02-28T09:47:38.000+0000 |
Updated | 2020-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
File | Date | Size |
---|---|---|
app.js | 2020-02-28T09:46:43.000+0000 | 45446 |
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.
I'll check. In 9.0.0 we have new property 'assetsDirectory' . Probably it can help to fix the issue. See TIMOB-27159.
[~vijaysingh] is correct. In Titanium 8.0.0, we switched out the native iOS implementation from Apple's deprecated
UIWebView
toWKWebView
. Apple'sWKWebView
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.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?
attached sample example also not working with SDK 8.2.1.GA - tested on iPhone 5s 12.4.4
[~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?
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.
[~jignesh.igp] wouldn't it be easier in that case to load the image from the remote url directly instead of downloading it?
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
Hi Rene Pot, can you please help me and suggest the solution ?
Hi, please follow instructions on how to configure this with SDK 9.0.0 (assetDirectory) and use 9.0.0 for your app.